diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2023-12-05 12:08:15 +0100 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2023-12-05 20:44:08 +0100 |
commit | 2c0cf2e0c933b16a107cc29451ad92d3a48bb481 (patch) | |
tree | f669c222dceaeff0214fb673c601f7a6b0c15fef /test/CheckManpage.py | |
parent | 14db8c8f10377607c85a7fe449af8001a64f088e (diff) | |
download | fork-ledger-2c0cf2e0c933b16a107cc29451ad92d3a48bb481.tar.gz fork-ledger-2c0cf2e0c933b16a107cc29451ad92d3a48bb481.tar.bz2 fork-ledger-2c0cf2e0c933b16a107cc29451ad92d3a48bb481.zip |
tests: Modernize test scripts
by using argparse and pathlib and removing Python 2 specific code.
Diffstat (limited to 'test/CheckManpage.py')
-rwxr-xr-x | test/CheckManpage.py | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/test/CheckManpage.py b/test/CheckManpage.py index e519a00a..1795b77e 100755 --- a/test/CheckManpage.py +++ b/test/CheckManpage.py @@ -19,24 +19,9 @@ class CheckManpage (CheckOptions): self.source_type = 'manpage' if __name__ == "__main__": - def getargs(): - parser = argparse.ArgumentParser(prog='CheckManpage', - description='Check that ledger options are documented in the manpage') - parser.add_argument('-l', '--ledger', - dest='ledger', - type=str, - action='store', - required=True, - help='the path to the ledger executable to test with') - parser.add_argument('-s', '--source', - dest='source', - type=str, - action='store', - required=True, - help='the path to the top level ledger source directory') - return parser.parse_args() - - args = getargs() + args = argparse.ArgumentParser(prog='CheckManpage', + description='Check that ledger options are documented in the manpage' + parents=[CheckOptions.parser()]).parse_args() script = CheckManpage(args) status = script.main() sys.exit(status) |