diff --git a/gitinspector.py b/gitinspector.py index d510057..413464a 100755 --- a/gitinspector.py +++ b/gitinspector.py @@ -100,7 +100,7 @@ if __name__ == "__main__": elif o in("-r", "--responsibilities"): __run__.responsibilities = True elif o in("--version"): - version.output() + format.call_output_function(version.output_html, version.output_text, version.output_xml) sys.exit(0) elif o in("--grading"): __run__.include_metrics = True diff --git a/version.py b/version.py index b7f0d97..ae1b466 100644 --- a/version.py +++ b/version.py @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with gitinspector. If not, see . -"""gitinspector {0} -Copyright © 2012 Ejwa Software. All rights reserved. +"""Copyright © 2012 Ejwa Software. All rights reserved. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. @@ -29,5 +28,13 @@ from __future__ import print_function __version__ = "0.1.0" -def output(): - print(__doc__.format(__version__)) +def output_html(string, _): + print("HTML output not yet supported.") + +def output_text(_): + print("gitinspector {0}\n".format(__version__) + __doc__) + +def output_xml(string, _): + license_text = "\t\t" + __doc__.replace("\n", "\n\t\t") + print(string.format("\n\t" + __version__ + "\n" + + "\t\n" + license_text + "\n\t\n"))