parameters: (cmd)
return_statement: return (arguments, short_help, long_help, flag_string)
docstring: Helps format plugin subcommands for display.
docstring_summary: Helps format plugin subcommands for display.
docstring_tokens: Helps format plugin subcommands for display .
function: def format_subcommands_help(cmd):
      """
      Helps format plugin subcommands for display.
      """
      arguments = " ".join(cmd["arguments"])
      short_help = cmd["short_help"]
      long_help = textwrap.dedent(cmd["long_help"].rstrip())
      long_help = "  " + "\n  ".join(long_help.lstrip().split('\n'))
      flags = cmd["flags"]
      flags["-h --help"] = "Show this screen."
      flag_string = ""
  
      if list(flags.keys()) != 0:
          longest_flag_name = max(list(flags.keys()), key=len)
          for flag in sorted(flags.keys()):
              num_spaces = len(longest_flag_name) - len(flag) + 2
              flag_string += "  %s%s%s\n" % (flag, " " * num_spaces, flags[flag])
      flag_string = flag_string.rstrip()
  
      return (arguments, short_help, long_help, flag_string)
function_tokens: def format_subcommands_help ( cmd ) : arguments = " " . join ( cmd [ "arguments" ] ) short_help = cmd [ "short_help" ] long_help = textwrap . dedent ( cmd [ "long_help" ] . rstrip ( ) ) long_help = "  " + "\n  " . join ( long_help . lstrip ( ) . split ( '\n' ) ) flags = cmd [ "flags" ] flags [ "-h --help" ] = "Show this screen." flag_string = "" if list ( flags . keys ( ) ) != 0 : longest_flag_name = max ( list ( flags . keys ( ) ) , key = len ) for flag in sorted ( flags . keys ( ) ) : num_spaces = len ( longest_flag_name ) - len ( flag ) + 2 flag_string += "  %s%s%s\n" % ( flag , " " * num_spaces , flags [ flag ] ) flag_string = flag_string . rstrip ( ) return ( arguments , short_help , long_help , flag_string )