aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2017-02-16 16:24:02 -0500
committerMike Frysinger <vapier@gentoo.org>2017-02-16 16:24:02 -0500
commit61c7be050d2cda96d13fc69b31efeb2c4bffebd5 (patch)
tree257a7bcba081db752d99143cb400934e1fc426f0
parentpylint: add a helper to keep python code clean (diff)
downloadpax-utils-61c7be050d2cda96d13fc69b31efeb2c4bffebd5.tar.gz
pax-utils-61c7be050d2cda96d13fc69b31efeb2c4bffebd5.tar.bz2
pax-utils-61c7be050d2cda96d13fc69b31efeb2c4bffebd5.zip
lddtree: move parser logic into a func
This keeps the main func a bit cleaner.
-rwxr-xr-xlddtree.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lddtree.py b/lddtree.py
index d1ec9e9..2bfaaae 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -641,8 +641,8 @@ def _ActionCopy(options, elf):
outdir=options.bindir)
-def main(argv):
- """The main entry point!"""
+def GetParser():
+ """Get a CLI parser."""
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
@@ -699,6 +699,12 @@ def main(argv):
action='store_true', default=False,
help='Copy over plain (non-ELF) files instead of warn+ignore')
+ return parser
+
+
+def main(argv):
+ """The main entry point!"""
+ parser = GetParser()
options = parser.parse_args(argv)
paths = options.path