Show More
@@ -185,19 +185,26 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 | |
|
193 |
if |
|
|
194 |
|
|
|
195 | print "----------------" | |
|
196 | print self.keyvalue_description | |
|
197 | ||
|
196 | if classes: | |
|
197 | if self.classes: | |
|
198 | print "Class parameters" | |
|
199 | print "----------------" | |
|
200 | print self.keyvalue_description | |
|
201 | ||
|
198 | 202 | |
|
199 | for cls in self.classes: | |
|
200 | cls.class_print_help() | |
|
203 | for cls in self.classes: | |
|
204 | cls.class_print_help() | |
|
205 | ||
|
206 | else: | |
|
207 | print "To see all available configurables, use `--help-all`" | |
|
201 | 208 | |
|
202 | 209 | |
|
203 | 210 | def print_description(self): |
@@ -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