code: def do_help(self, args):
          '''print help on a command'''
          if args.command:
              f = getattr(self, 'help_' + args.command, None)
              if f:
                  f()
                  return
  
              f = getattr(self, 'do_' + args.command, None)
              if not f:
                  msg = self.nohelp % (args.command,)
                  self.stdout.write('{0}\n'.format(msg))
                  return
  
              docstr = getattr(f, '__doc__', None)
              f = getattr(self, 'args_' + args.command, None)
              if f:
                  parser = argparse.ArgumentParser(
                      prog=args.command,
                      description=docstr)
                  f(parser)
                  parser.print_help(file=self.stdout)
              else:
                  if not docstr:
                      docstr = self.nohelp % (args.command,)
                  self.stdout.write('{0}\n'.format(docstr))
          else:
              Cmd.do_help(self, ''f do_help(self, args):
          '''print help on a command'''
          if args.command:
              f = getattr(self, 'help_' + args.command, None)
              if f:
                  f()
                  return
  
              f = getattr(self, 'do_' + args.command, None)
              if not f:
                  msg = self.nohelp % (args.command,)
                  self.stdout.write('{0}\n'.format(msg))
                  return
  
              docstr = getattr(f, '__doc__', None)
              f = getattr(self, 'args_' + args.command, None)
              if f:
                  parser = argparse.ArgumentParser(
                      prog=args.command,
                      description=docstr)
                  f(parser)
                  parser.print_help(file=self.stdout)
              else:
                  if not docstr:
                      docstr = self.nohelp % (args.command,)
                  self.stdout.write('{0}\n'.format(docstr))
          else:
              Cmd.do_help(self, '')
docs: print help on a command