diff --git a/docs/source/commands/lint.rst b/docs/source/commands/lint.rst new file mode 100644 index 00000000..2ea5ee6b --- /dev/null +++ b/docs/source/commands/lint.rst @@ -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)` diff --git a/powerline/commands/lint.py b/powerline/commands/lint.py new file mode 100755 index 00000000..a09aa35c --- /dev/null +++ b/powerline/commands/lint.py @@ -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 diff --git a/scripts/powerline-lint b/scripts/powerline-lint index cfebad3e..f665ba14 100755 --- a/scripts/powerline-lint +++ b/scripts/powerline-lint @@ -1,20 +1,13 @@ #!/usr/bin/env python # vim:fileencoding=utf-8:noet - -'''Powerline configuration checker.''' - from __future__ import (unicode_literals, division, absolute_import, print_function) -import argparse import sys 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__': - args = parser.parse_args() + args = get_argparser().parse_args() sys.exit(check(args.config_path, args.debug))