mirror of
https://github.com/powerline/powerline.git
synced 2025-07-26 07:16:31 +02:00
Add line breaks to powerline/commands/config.py
This commit is contained in:
parent
d37711a47e
commit
99505751d0
@ -43,7 +43,12 @@ class ConfigArgParser(argparse.ArgumentParser):
|
|||||||
|
|
||||||
def get_argparser(ArgumentParser=ConfigArgParser):
|
def get_argparser(ArgumentParser=ConfigArgParser):
|
||||||
parser = ArgumentParser(description='Script used to obtain powerline configuration.')
|
parser = ArgumentParser(description='Script used to obtain powerline configuration.')
|
||||||
parser.add_argument('-p', '--config-path', action='append', metavar='PATH', help='Path to configuration directory. If it is present then configuration files will only be seeked in the provided path. May be provided multiple times to search in a list of directories.')
|
parser.add_argument(
|
||||||
|
'-p', '--config-path', action='append', metavar='PATH',
|
||||||
|
help='Path to configuration directory. If it is present '
|
||||||
|
'then configuration files will only be seeked in the provided path. '
|
||||||
|
'May be provided multiple times to search in a list of directories.'
|
||||||
|
)
|
||||||
subparsers = parser.add_subparsers()
|
subparsers = parser.add_subparsers()
|
||||||
tmux_parser = subparsers.add_parser('tmux', help='Tmux-specific commands')
|
tmux_parser = subparsers.add_parser('tmux', help='Tmux-specific commands')
|
||||||
tmux_parser.add_argument(
|
tmux_parser.add_argument(
|
||||||
@ -51,7 +56,10 @@ def get_argparser(ArgumentParser=ConfigArgParser):
|
|||||||
choices=tuple(TMUX_ACTIONS.values()),
|
choices=tuple(TMUX_ACTIONS.values()),
|
||||||
metavar='ACTION',
|
metavar='ACTION',
|
||||||
type=(lambda v: TMUX_ACTIONS.get(v)),
|
type=(lambda v: TMUX_ACTIONS.get(v)),
|
||||||
help='If action is `source\' then version-specific tmux configuration files are sourced, if it is `setenv\' then special (prefixed with `_POWERLINE\') tmux global environment variables are filled with data from powerline configuration.'
|
help='If action is `source\' then version-specific tmux configuration '
|
||||||
|
'files are sourced, if it is `setenv\' then special '
|
||||||
|
'(prefixed with `_POWERLINE\') tmux global environment variables '
|
||||||
|
'are filled with data from powerline configuration.'
|
||||||
)
|
)
|
||||||
|
|
||||||
shell_parser = subparsers.add_parser('shell', help='Shell-specific commands')
|
shell_parser = subparsers.add_parser('shell', help='Shell-specific commands')
|
||||||
@ -60,14 +68,20 @@ def get_argparser(ArgumentParser=ConfigArgParser):
|
|||||||
choices=tuple(SHELL_ACTIONS.values()),
|
choices=tuple(SHELL_ACTIONS.values()),
|
||||||
type=(lambda v: SHELL_ACTIONS.get(v)),
|
type=(lambda v: SHELL_ACTIONS.get(v)),
|
||||||
metavar='ACTION',
|
metavar='ACTION',
|
||||||
help='If action is `command\' then preferred powerline command is output, if it is `uses\' then powerline-config script will exit with 1 if specified component is disabled and 0 otherwise.',
|
help='If action is `command\' then preferred powerline command is '
|
||||||
|
'output, if it is `uses\' then powerline-config script will exit '
|
||||||
|
'with 1 if specified component is disabled and 0 otherwise.',
|
||||||
)
|
)
|
||||||
shell_parser.add_argument(
|
shell_parser.add_argument(
|
||||||
'component',
|
'component',
|
||||||
nargs='?',
|
nargs='?',
|
||||||
choices=('tmux', 'prompt'),
|
choices=('tmux', 'prompt'),
|
||||||
metavar='COMPONENT',
|
metavar='COMPONENT',
|
||||||
help='Only applicable for `uses\' subcommand: makes `powerline-config\' exit with 0 if specific component is enabled and with 1 otherwise. `tmux\' component stands for tmux bindings (e.g. those that notify tmux about current directory changes), `prompt\' component stands for shell prompt.'
|
help='Only applicable for `uses\' subcommand: makes `powerline-config\' '
|
||||||
|
'exit with 0 if specific component is enabled and with 1 otherwise. '
|
||||||
|
'`tmux\' component stands for tmux bindings '
|
||||||
|
'(e.g. those that notify tmux about current directory changes), '
|
||||||
|
'`prompt\' component stands for shell prompt.'
|
||||||
)
|
)
|
||||||
shell_parser.add_argument(
|
shell_parser.add_argument(
|
||||||
'-s', '--shell',
|
'-s', '--shell',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user