diff --git a/ChangeLog b/ChangeLog index da79607bb..643542aec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-25 Łukasz Rymarczyk + * src/ReportBase/_CommandLineReport.py: add user friendly output to cli + gramps.py -u --open=merge --action=report -p "name=indiv_complete,show=all" + #0001823 + 2008-02-25 Łukasz Rymarczyk * src/ArgHandler.py: add UI Report Names to output 0001826: Command line - viewing available reports nicer to read diff --git a/src/ReportBase/_CommandLineReport.py b/src/ReportBase/_CommandLineReport.py index 80a12f392..49ee568e5 100644 --- a/src/ReportBase/_CommandLineReport.py +++ b/src/ReportBase/_CommandLineReport.py @@ -2,6 +2,7 @@ # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001-2007 Donald N. Allingham +# Copyright (C) 2008 Lukasz Rymarczyk # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -198,14 +199,27 @@ class CommandLineReport: self.options_help['style'].append(False) def show_options(self): + """ + Print available options on the CLI. + """ if not self.show: return elif self.show == 'all': print " Available options:" for key in self.options_dict.keys(): - print " %s" % key - print \ - " Use 'show=option' to see description and acceptable values" + if key in self.options_dict.keys(): + # Make the output nicer to read, assume that tab has 8 spaces + if len(key) < 10: + print " %s\t\t%s (%s)" % (key, + self.options_help[key][1], + self.options_help[key][0]) + else: + print " %s\t%s (%s)" % (key, + self.options_help[key][1], + self.options_help[key][0]) + else: + print " %s" % key + print " Use 'show=option' to see description and acceptable values" elif self.show in self.options_dict.keys(): print ' %s%s\t%s' % (self.show, self.options_help[self.show][0],