Also add documentation for `powerline-lint`

This commit is contained in:
ZyX 2014-10-25 21:53:15 +04:00
parent bed2cc8d0f
commit 9b03ff6936
3 changed files with 25 additions and 9 deletions

View File

@ -0,0 +1,12 @@
:orphan:
powerline-lint manual page
==========================
.. automan:: powerline.commands.lint
:prog: powerline-lint
See also
--------
:manpage:`powerline(1)`, :manpage:`powerline-config(1)`

11
powerline/commands/lint.py Executable file
View File

@ -0,0 +1,11 @@
# vim:fileencoding=utf-8:noet
from __future__ import (division, absolute_import, print_function)
import argparse
def get_argparser(ArgumentParser=argparse.ArgumentParser):
parser = ArgumentParser(description='Powerline configuration checker.')
parser.add_argument('-p', '--config_path', action='append', metavar='PATH', help='Paths where configuration should be checked, in order. You must supply all paths necessary for powerline to work, checking partial (e.g. only user overrides) configuration is not supported.')
parser.add_argument('-d', '--debug', action='store_const', const=True, help='Display additional information. Used for debugging `powerline-lint\' itself, not for debugging configuration.')
return parser

View File

@ -1,20 +1,13 @@
#!/usr/bin/env python #!/usr/bin/env python
# vim:fileencoding=utf-8:noet # vim:fileencoding=utf-8:noet
'''Powerline configuration checker.'''
from __future__ import (unicode_literals, division, absolute_import, print_function) from __future__ import (unicode_literals, division, absolute_import, print_function)
import argparse
import sys import sys
from powerline.lint import check from powerline.lint import check
from powerline.commands.lint import get_argparser
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-p', '--config_path', action='append', metavar='PATH')
parser.add_argument('-d', '--debug', action='store_const', const=True)
if __name__ == '__main__': if __name__ == '__main__':
args = parser.parse_args() args = get_argparser().parse_args()
sys.exit(check(args.config_path, args.debug)) sys.exit(check(args.config_path, args.debug))