def do_help(self, parsed): """ HELP [cqlsh only] Gives information about cqlsh commands. To see available topics, enter 'HELP' without any arguments. To see help on a topic type 'HELP <topic>'. For example 'HELP CAPTURE' or 'HELP ALTER_KEYSPACE'. Full documentation available at: https://docs.datastax.com/en/dse/6.7/cql/index.html """ topics = parsed.get_binding('topic', ()) if not topics: shell_topics = [t.upper() for t in self.get_help_topics()] print self.print_topics("Shell command help topics:", shell_topics, 15, 80) print "Full documentation for shell commands:" print " https://docs.datastax.com/en/dse/6.7/cql/cql/cql_reference/cqlsh_commands/cqlshCommandsTOC.html" print cql_topics = get_terminal_help_topics() self.print_topics("CQL command help topics:", cql_topics, 15, 80) print "Full documentation for CQL commands:" print " https://docs.datastax.com/en/dse/6.7/cql/cql/cql_reference/cql_commands/cqlCommandsTOC.html" print return for t in topics: if t.lower() in self.get_help_topics(): doc = getattr(self, 'do_' + t.lower()).__doc__ self.stdout.write(doc + "\n") elif t.lower() in get_terminal_help_topics(): print_terminal_help_topic(t) else: self.printerr("*** No help on %s" % (t,))
def complete_help(ctxt, cqlsh): return sorted([ t.upper() for t in get_terminal_help_topics() + cqlsh.get_help_topics() ])