File: options.py

package info (click to toggle)
python-dcos 0.2.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,440 kB
  • sloc: python: 8,196; sh: 194; makefile: 36
file content (26 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def make_command_summary_string(command_summaries):
    """Construct subcommand summaries

    :param command_summaries: Commands and their summaries
    :type command_summaries: list of (str, str)
    :returns: The subcommand summaries
    :rtype: str
    """

    doc = ''
    for command, summary in command_summaries:
        doc += '\n\t{:15}\t{}'.format(command, summary.strip())

    return doc


def make_generic_usage_message(doc):
    """Construct generic usage error

    :param doc: Usage documentation for program
    :type doc: str
    :returns: Generic usage error
    :rtype: str
    """

    return 'Unknown option\n{}'.format(doc)