def do_help(self, cmd=None): Cmd.do_help(self, cmd) if not cmd or not self.show_usage: return do_ = getattr(self, "do_" + cmd, None) if not do_ or hasattr(self, "help_ " + cmd): return while (hasattr(do_, "__wrapped__") and not getattr(do_, USE_MY_ANNOTATIONS, None)): do_ = do_.__wrapped__ if getattr(do_, GETS_RAW, None): return spec = getfullargspec(do_) args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = spec non_kw_args = args[:-len(defaults)] if defaults else args kw_args = args[-len(defaults):] if defaults else [] if not defaults: defaults = [] if not kwonlydefaults: kwonlydefaults = {} helpstr = "\t" + cmd for arg, default in kwonlydefaults.items(): helpstr += " [-{0} {1}(={2})]".format(arg, arg[0].upper(), default) for arg, default in zip(kw_args, defaults): helpstr += " [{0}(={1})]".format(arg.upper(), default) for arg in non_kw_args[1:]: helpstr += " {0}".format(arg.upper()) if varargs: helpstr += " [{0}]".format(varargs.upper()) self.stdout.write(helpstr + "\n")
def do_help(self, args): """ Gets help for a certain command :param args: Any input you need help with :return: Documented comments about the command """ Cmd.do_help(self, args)
def do_help(self, args): """Get help on commands 'help' or '?' with no arguments prints a list of commands for which help is available 'help <command>' or '? <command>' gives help on <command> """ # The only reason to define this method is for the help text in the doc string Cmd.do_help(self, args)
def do_help(self, line): """ Describe available CLI commands. """ Cmd.do_help(self, line) if line is '': output(self.helpStr)
def do_help(self, arg): if arg: Cmd.do_help(self, arg) else: self.say("") headerString = "These are valid commands for Jarvis" formatString = "Format: command ([aliases for command])" self.say(headerString) self.say(formatString, Fore.BLUE) pluginDict = self._plugin_manager.get_plugins() uniquePlugins = {} for key in pluginDict.keys(): plugin = pluginDict[key] if(plugin not in uniquePlugins.keys()): uniquePlugins[plugin.get_name()] = plugin helpOutput = [] for name in sorted(uniquePlugins.keys()): if (name == "help"): continue try: aliasString = ", ".join(uniquePlugins[name].alias()) if (aliasString != ""): pluginOutput = "* " + name + " (" + aliasString + ")" helpOutput.append(pluginOutput) else: helpOutput.append("* " + name) except AttributeError: helpOutput.append("* " + name) Cmd.columnize(self, helpOutput)
def do_help(self, args): """ Getting help on "help" is kinda silly dont you think? """ #The only reason to define this method is for the help text in the #docstring Cmd.do_help(self, args)
def do_help(self, args): """ Getting help on "help" is kinda silly dont you think? """ #The only reason to define this method is for the help text in the #docstring Cmd.do_help(self, args)
def do_help(self, arg): if arg: Cmd.do_help(self, arg) else: # Everything from here to the end is lifted straight # out of cmd.Cmd.do_help() names = self.get_names() cmds_doc = [] cmds_undoc = [] help = {} for name in names: if name[:5] == 'help_': help[name[5:]]=1 names.sort() # There can be duplicates if routines overridden prevname = '' for name in names: if name[:3] == 'do_': if name == prevname: continue prevname = name cmd=name[3:] if cmd in help: cmds_doc.append(cmd) del help[cmd] elif getattr(self, name).__doc__: cmds_doc.append(cmd) else: cmds_undoc.append(cmd) self.stdout.write("%s\n"%str(self.doc_leader)) self.print_topics(self.doc_header, cmds_doc, 15,80) self.print_topics(self.misc_header, help.keys(),15,80)
def do_help(self, line): """ Describe available CLI commands. """ Cmd.do_help(self, line) if line is "": output(self.helpStr)
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, '')
def do_help(self, args): """Get help on commands 'help' or '?' with no arguments prints a list of commands for which help is available 'help <command>' or '? <command>' gives help on <command> """ ## The only reason to define this method is for the help text in the doc string Cmd.do_help(self, args)
def do_help(self, args): """Override the help command to handle cases of command arguments. General help is provided by help_*() methods.""" if len(args.split()) < 2: Cmd.do_help(self, args) else: if args == 'talk show': print Help.TALK_SHOW_TALKS elif args == 'talk show events': print Help.TALK_SHOW_EVENTS elif args == 'talk remove': print Help.TALK_REMOVE elif args == 'talk add': print Help.TALK_ADD elif args == 'talk update': print Help.TALK_UPDATE elif args == 'config show': print Help.CONFIG_SHOW elif args == 'config set audio': print Help.CONFIG_SET_AUDIO elif args == 'config set video': print Help.CONFIG_VIDEO_SET elif args == 'config set video resolution': print Help.CONFIG_VIDEO_RESOLUTION_SET elif args == 'config set dir': print Help.CONFIG_DIR_SET elif args == 'config set streaming': print Help.CONFIG_SET_STREAMING elif args == 'config set file': print Help.CONFIG_SET_FILE elif args == 'config set': print Help.CONFIG_SET else: print 'Unknown %s topic' % (args)
def do_help(self, arg): if arg: Cmd.do_help(self, arg) else: print "Available commands:", print ", ".join([ name[3:] for name in dir(self) if name.startswith('do_') and getattr(self, name).__doc__ ]) print "Use 'help <command>' for details."
def do_help(self, line): "Describe available CLI commands." Cmd.do_help(self, line) if line == "": output("\n*** Mininet CLI usage:\n") output(super(CLI, self).helpStr) output("*** ComNetsEmu CLI usage:\n") output(self.helpStr)
def do_help(self, args): if args == '': Cmd.do_help(self, args) else: if 'do_%s' % args in dir(self): code = 'doc_string = self.do_%s.__doc__' % args exec(code) print doc_string
def do_help(self, arg): values = arg.split(' ') if len(values) == 1 and values[0] == '': help_title = Style.BRIGHT + Fore.MAGENTA + "uArm Command line Help Center" + Fore.RESET + Style.RESET_ALL help_title += "\n\n" help_title += "Please use {}{}connect{}{} before any control action".format(Back.BLACK, Fore.WHITE, Fore.RESET, Back.RESET) help_title += "\n" help_title += self.help_msg print (help_title) # print (self.help_msg) Cmd.do_help(self,arg)
def do_help(self, arg): values = arg.split(' ') if len(values) == 1 and values[0] == '': help_title = Style.BRIGHT + Fore.MAGENTA + "uArm Command line Help Center" + Fore.RESET + Style.RESET_ALL help_title += "\n\n" help_title += "Please use {}{}connect{}{} before any control action".format(Back.BLACK, Fore.WHITE, Fore.RESET, Back.RESET) help_title += "\n" help_title += self.help_msg print (help_title) # print (self.help_msg) Cmd.do_help(self,arg)
def do_help(self, args): ''' Get help on command \'help\' or \'?\' with no arguments prints a list of commands for which help is available \'help <command>\' or \'? <command>\' gives help on <command> ''' # The only reason to define this method is for the help text in # the doc string Cmd.do_help(self, args)
def do_help(self, arg): values = arg.split(' ') if len(values) == 1 and values[0] == '': help_title = "uArm Command line Help Center" help_title += "\n\n" help_title += "Please use connect before any control action" help_title += "\n" help_title += self.help_msg print (help_title) # print (self.help_msg) Cmd.do_help(self,arg)
def do_help(self, arg): """Print help topic""" argv = arg.split() if argv and argv[0] in ['set']: # Provide extended help help_def = getattr(self, "help_" + argv[0]) if help_def: help_def(' '.join(argv[1:])) else: Cmd.do_help(self, arg) else: Cmd.do_help(self, arg)
def do_help(self, string=''): if '' != string: logd('help for %s' % string) if (string.upper() in self._cmd_dict.keys()): print('\t%s' % self._cmd_dict[string.upper()]) elif (string.lower() in self._cmd_dict.keys()): print('\t%s' % self._cmd_dict[string.lower()]) else: Cmd.do_help(self, string)
def do_help(self, string = ''): if '' != string: logd('help for %s' % string) if (string.upper() in self._cmd_dict.keys()): print('\t%s' % self._cmd_dict [string.upper()]) elif (string.lower() in self._cmd_dict.keys()): print('\t%s' % self._cmd_dict [string.lower()]) else: Cmd.do_help(self, string)
def do_help(self, arg): """Print help topic""" argv = arg.split() if argv and argv[0] in ['set']: # Provide extended help help_def = getattr(self, "help_"+argv[0]) if help_def: help_def(' '.join(argv[1:])) else: Cmd.do_help(self, arg) else: Cmd.do_help(self, arg)
def do_help(self, line): """Print help for the program or its commands. """ if not line.strip() or len(line.split()) != 1: return Cmd.do_help(self, line) matches = filter(lambda a: a.lower() == "do_" + line.lower().strip(), dir(self)) if len(matches) != 1: return Cmd.do_help(self, line) try: txt = eval("self." + matches[0]).__doc__ except AttributeError: return Cmd.do_help(self, line) self.msg(self._formatHelp(txt))
def do_help(self, arg): """Type help <topic> to see the help for a given topic""" """ Overload do_help to show help from the command parser if it exists: if there is a parser_foo() method, assume this method returns a YokadiOptionParser for the do_foo() method and show the help of the parser, instead of do_foo() docstring. """ if arg in self.aliases: # If arg is an alias, get help on the underlying command arg = self.aliases[arg].split()[0] if hasattr(self, "parser_" + arg): parserMethod = getattr(self, "parser_" + arg) parserMethod().print_help(sys.stderr) else: print("Usage: ", end=' ') Cmd.do_help(self, arg)
def do_help(self, s): """Help introduction message""" if s != "": Cmd.do_help(self, s) return print( "\nYour login information will be retained for the duration of this session" ) print("Possible shell commands include:\n") for name, descript in list(self.subcommand_desc.items()): print("\t%-20s" % (name) + descript) print("\n\t%-20s" % ("exit") + "Exit the interpreter, and end this session") print( "\nHelp commands take the form of either:\n help reg || ? reg || reg -h || reg --help" )
def do_help(self, arg): """Type help <topic> to see the help for a given topic""" """ Overload do_help to show help from the command parser if it exists: if there is a parser_foo() method, assume this method returns a YokadiOptionParser for the do_foo() method and show the help of the parser, instead of do_foo() docstring. """ if arg in self.aliases: # If arg is an alias, get help on the underlying command arg = self.aliases[arg].split()[0] if hasattr(self, "parser_" + arg): parserMethod = getattr(self, "parser_" + arg) parserMethod().print_help(sys.stderr) else: print("Usage: ", end=' ') Cmd.do_help(self, arg)
def do_help(self, args): ''' help [cmd] - Show help on command cmd. Modified from base class. ''' commands = self.cluster.get_commands() if args: if args in commands: docstr, _ = commands.get(args) print docstr return return Cmd.do_help(self, args) print self.dustintro print "\nAvailable commands:\n" # generate help summary from docstrings names = dir(self.__class__) prevname = "" for name in names: if name[:3] == 'do_': if name == prevname: continue cmd = name[3:] docstr = "" if getattr(self, name): docstr = getattr(self, name).__doc__ self._print_cmd_help(docstr, cmd) # show help from drop-in commands modcommands = defaultdict(list) for cmd, (docstr, mod) in commands.items(): modcommands[mod].append( (cmd, docstr) ) for mod, cmds in modcommands.iteritems(): print "\n== From %s:" % mod.__name__ for (cmd, docstr) in cmds: self._print_cmd_help(docstr, cmd) print '\nType help [command] for detailed help on a command' print '\nFor most commands, [target] can be a node name, regular expression, or filter expression' print 'A node "name" in these commands is the Name tag in the cloud node metadata or in the cluster definition.' print '\n'
def do_help(self, line): """I think you know what this does.""" # this works around a misfeature in cmd.py # getdoc is better at docs than the raw (cleans them up) line = line.strip() try: if line and not getattr(self, 'help_' + line, None): from pydoc import getdoc docs = getdoc(getattr(self, 'do_' + line)) if not docs: docs = '(to be documented)' self.stdout.write("%s: %s\n" % (ansi.BOLD + line + ansi.RESET, str(docs))) return except: pass return Cmd.do_help(self, line)
def do_help(self, line): """I think you know what this does.""" # this works around a misfeature in cmd.py # getdoc is better at docs than the raw (cleans them up) line = line.strip() try: if line and not getattr(self, 'help_' + line, None): from pydoc import getdoc docs = getdoc(getattr(self, 'do_' + line)) if not docs: docs = '(to be documented)' self.stdout.write("%s: %s\n" % (ansi.BOLD + line + ansi.RESET, str(docs))) return except: pass return Cmd.do_help(self, line)
def do_help(self, arg): '''List available commands with 'help' or detailed help with 'help cmd'. ''' if not arg: return Cmd.do_help(self, arg) arg = arg.replace('-', '_') try: doc = getattr(self, 'do_' + arg).__doc__ if doc: doc = doc.format(command=arg) self.stdout.write('%s\n' % trim(str(doc))) return except AttributeError: pass self.stdout.write('%s\n' % str(self.nohelp % (arg, ))) return
def do_help(self, line): if line: return Cmd.do_help(self, line) self.basecmds.sort() self.vprint('\nbasics:') for line in formatargs(self.basecmds): self.vprint(line) subsys = self.extsubsys.keys() subsys.sort() for sub in subsys: self.vprint('\n%s:' % sub) cmds = self.extsubsys.get(sub) cmds.sort() for line in formatargs(cmds): self.vprint(line) self.vprint('\n')
def do_help(self, line): if line: return Cmd.do_help(self, line) self.basecmds.sort() self.vprint('\nbasics:') # self.vprint( self.columnize( self.basecmds ) ) self.columnize(self.basecmds) subsys = list(self.extsubsys.keys()) subsys.sort() for sub in subsys: self.vprint('\n%s:' % sub) cmds = self.extsubsys.get(sub) cmds.sort() self.columnize(cmds) self.vprint('\n')
def do_help(self, line): if line: return Cmd.do_help(self, line) self.basecmds.sort() self.vprint('\nbasics:') #self.vprint( self.columnize( self.basecmds ) ) self.columnize(self.basecmds) subsys = self.extsubsys.keys() subsys.sort() for sub in subsys: self.vprint('\n%s:' % sub) cmds = self.extsubsys.get(sub) cmds.sort() self.columnize(cmds) self.vprint('\n')
def do_options(self, line): """\tDisplays the help menu\n""" Cmd.do_help(self, line)
def do_help(self, line): """Describe available CLI commands.""" Cmd.do_help(self, line) if line is '': print(self.help_str)
def do_help(self, line): """Get help on commands. 'help' or '?' with no arguments prints a list of commands for which help is available 'help <command>' or '? <command>' gives help on <command> """ Cmd.do_help(self, line)
def do_help(self,arg): """ output help of command """ Cmd.do_help(self,arg)
def do_help(self, arg): '''Print help message''' Cmd.do_help(self, arg)
def do_help(self, line): # pylint: disable=arguments-differ "Describe available CLI commands." Cmd.do_help(self, line) if line == '': output(self.helpStr)
def do_systemhelp(self, arg): return Cmd.do_help(self, arg)
def do_help(self, arg): if self._current_server: print self.rcon("help " + arg) else: return Cmd.do_help(self, arg)
def do_help(self, *args): "Display help\nhelp [command]" return Cmd.do_help(self, *args)
def do_help(self, arg): """Print help message""" Cmd.do_help(self, arg)
def do_help(self, arg): '''Print help message''' Cmd.do_help(self, arg)
def do_help( self, line ): "Describe available CLI commands." #pdb.set_trace() Cmd.do_help( self, line ) if line is '': output( self.helpStr )
def do_help(self, arg): """A version of help that deals with the array args""" return Cmd.do_help(self, " ".join(arg))
def do_help(self, *args): """\tDisplays the help menu\n""" Cmd.do_help(self, *args)
def do_help(self, args): """Get help on commands""" Cmd.do_help(self, args)
def do_help( self, arg ): if arg: Cmd.do_help( self, arg ) else: print "Available commands:", print ", ".join( [ name[ 3 : ] for name in dir( self ) if name.startswith( 'do_' ) and getattr( self, name ).__doc__ ] ) print "Use 'help <command>' for details."
def do_help(self, s): "Print help" Cmd.do_help(self, s) if s is "": print self.helpStr
def do_help(self, arg): """A version of help that deals with the array args""" return Cmd.do_help(self, " ".join(arg))
def do_help( self, line ): "Describe available CLI commands." Cmd.do_help( self, line ) if line is '': output( self.helpStr ) self.not_implemented()
def do_help(self, arg): if arg in self.aliases: arg = self.aliases[arg].__name__[3:] Cmd.do_help(self, arg)
def do_help(self, line): "Describe available CLI commands." Cmd.do_help(self, line) if line == '': print(self.helpStr)
def do_help(self, arg): "Describe available CLI commands." Cmd.do_help(self, arg) if arg == '': print(self.helpStr)
def do_help(self, args): Cmd.do_help(self, args)