Exemplo n.º 1
0
def GenerateHelpForPositional(token, width):
    gen = markdown.CliTreeMarkdownGenerator(gcloud_tree, gcloud_tree)
    gen.PrintPositionalDefinition(markdown.Positional(token.tree))
    mark = gen.Edit()

    fin = StringIO.StringIO(mark)
    return render_document.MarkdownRenderer(token_renderer.TokenRenderer(
        width=width, height=HELP_WINDOW_HEIGHT),
                                            fin=fin).Run()
Exemplo n.º 2
0
def GenerateHelpForPositional(cli, token, width):
  """Returns help lines for a positional token."""
  gen = markdown.CliTreeMarkdownGenerator(cli.root, cli.root)
  gen.PrintPositionalDefinition(markdown.Positional(token.tree))
  mark = gen.Edit()

  fin = StringIO.StringIO(mark)
  return render_document.MarkdownRenderer(
      token_renderer.TokenRenderer(
          width=width, height=cli.config.help_lines), fin=fin).Run()
Exemplo n.º 3
0
def GetDefinitionForPositional(token):
    """Gets the definition for the positional specified in token.

  Args:
    token: the ArgTokenType.POSITIONAL token for which to get the definition.

  Returns:
    A StringIO with the definition of the token.
  """
    gen = markdown.CliTreeMarkdownGenerator(gcloud_tree, gcloud_tree)
    gen.PrintPositionalDefinition(markdown.Positional(token.tree))
    mark = gen.Edit()
    return StringIO.StringIO(mark)