Changeset 283
- Timestamp:
- 24-06-07 21:52:23 (6 years ago)
- Location:
- trunk/moap/extern/command
- Files:
-
- 1 added
- 1 edited
-
ChangeLog (added)
-
command.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/moap/extern/command/command.py
r268 r283 183 183 return ret 184 184 185 # handle pleas for help 186 if args and args[0] == 'help': 187 self.debug('Asked for help, args %r' % args) 188 189 # give help on current command if only 'help' is passed 190 if len(args) == 1: 191 self.outputHelp() 192 return 0 193 194 # complain if we were asked for help on a subcommand, but we don't 195 # have any 196 if not self.subCommands: 197 self.stderr.write('No subcommands defined.') 198 self.parser.print_usage(file=self.stderr) 199 self.stderr.write( 200 "Use --help to get more information about this command.\n") 201 return 1 202 203 # rewrite the args the other way around; 204 # help doap becomes doap help so it gets deferred to the doap 205 # command 206 args = [args[1], args[0]] 207 185 208 # if we don't have subcommands, defer to our do() method 186 209 if not self.subCommands: … … 206 229 return 1 207 230 231 def outputHelp(self): 232 """ 233 Output help information. 234 """ 235 self.parser.print_help(file=self.stderr) 236 208 237 def outputUsage(self): 209 238 """
Note: See TracChangeset
for help on using the changeset viewer.
