##// END OF EJS Templates
add `--help-all` flag, and don't print all configurables by default
MinRK -
Show More
@@ -185,11 +185,15 b' class Application(SingletonConfigurable):'
185 185 lines.append('')
186 186 print '\n'.join(lines)
187 187
188 def print_help(self):
189 """Print the help for each Configurable class in self.classes."""
188 def print_help(self, classes=False):
189 """Print the help for each Configurable class in self.classes.
190
191 If classes=False (the default), only flags and aliases are printed
192 """
190 193 self.print_flag_help()
191 194 self.print_alias_help()
192 195
196 if classes:
193 197 if self.classes:
194 198 print "Class parameters"
195 199 print "----------------"
@@ -199,6 +203,9 b' class Application(SingletonConfigurable):'
199 203 for cls in self.classes:
200 204 cls.class_print_help()
201 205 print
206 else:
207 print "To see all available configurables, use `--help-all`"
208 print
202 209
203 210 def print_description(self):
204 211 """Print the application description."""
@@ -223,9 +230,9 b' class Application(SingletonConfigurable):'
223 230 """Parse the command line arguments."""
224 231 argv = sys.argv[1:] if argv is None else argv
225 232
226 if '-h' in argv or '--help' in argv:
233 if '-h' in argv or '--help' in argv or '--help-all' in argv:
227 234 self.print_description()
228 self.print_help()
235 self.print_help('--help-all' in argv)
229 236 self.exit(0)
230 237
231 238 if '--version' in argv:
General Comments 0
You need to be logged in to leave comments. Login now