Show More
@@ -185,19 +185,26 b' class Application(SingletonConfigurable):' | |||||
185 | lines.append('') |
|
185 | lines.append('') | |
186 | print '\n'.join(lines) |
|
186 | print '\n'.join(lines) | |
187 |
|
187 | |||
188 | def print_help(self): |
|
188 | def print_help(self, classes=False): | |
189 |
"""Print the help for each Configurable class in self.classes. |
|
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 | self.print_flag_help() |
|
193 | self.print_flag_help() | |
191 | self.print_alias_help() |
|
194 | self.print_alias_help() | |
192 |
|
195 | |||
193 |
if |
|
196 | if classes: | |
194 |
|
|
197 | if self.classes: | |
195 | print "----------------" |
|
198 | print "Class parameters" | |
196 | print self.keyvalue_description |
|
199 | print "----------------" | |
197 |
|
200 | print self.keyvalue_description | ||
|
201 | ||||
198 |
|
202 | |||
199 | for cls in self.classes: |
|
203 | for cls in self.classes: | |
200 | cls.class_print_help() |
|
204 | cls.class_print_help() | |
|
205 | ||||
|
206 | else: | |||
|
207 | print "To see all available configurables, use `--help-all`" | |||
201 |
|
208 | |||
202 |
|
209 | |||
203 | def print_description(self): |
|
210 | def print_description(self): | |
@@ -223,9 +230,9 b' class Application(SingletonConfigurable):' | |||||
223 | """Parse the command line arguments.""" |
|
230 | """Parse the command line arguments.""" | |
224 | argv = sys.argv[1:] if argv is None else argv |
|
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 | self.print_description() |
|
234 | self.print_description() | |
228 | self.print_help() |
|
235 | self.print_help('--help-all' in argv) | |
229 | self.exit(0) |
|
236 | self.exit(0) | |
230 |
|
237 | |||
231 | if '--version' in argv: |
|
238 | if '--version' in argv: |
General Comments 0
You need to be logged in to leave comments.
Login now