aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-11-23 06:38:24 -0500
committerMike Frysinger <vapier@gentoo.org>2015-11-23 06:38:24 -0500
commitb7397ef293137c1451d5366fc29f7a9dd1fd808a (patch)
tree87b6fd2e14f9245adba920e0943e09e2e32e2a65
parentstagebase.py: Fix the empty .../build/default/stage* directory creation (diff)
downloadcatalyst-b7397ef293137c1451d5366fc29f7a9dd1fd808a.tar.gz
catalyst-b7397ef293137c1451d5366fc29f7a9dd1fd808a.tar.bz2
catalyst-b7397ef293137c1451d5366fc29f7a9dd1fd808a.zip
main: take argv as an argument
Make the args explicit rather than relying on global sys.argv state. This is standard form and makes testing easier.
-rwxr-xr-xbin/catalyst2
-rw-r--r--catalyst/main.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/bin/catalyst b/bin/catalyst
index 24122b2..72a4cb4 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -34,7 +34,7 @@ except KeyboardInterrupt:
from catalyst.main import main
try:
- main()
+ main(sys.argv[1:])
except KeyboardInterrupt:
print("Aborted.")
sys.exit(130)
diff --git a/catalyst/main.py b/catalyst/main.py
index 176871d..f48293e 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -203,9 +203,9 @@ $ catalyst -f stage1-specfile.spec"""
return parser
-def main():
+def main(argv):
parser = get_parser()
- opts = parser.parse_args(sys.argv[1:])
+ opts = parser.parse_args(argv)
# Initialize the logger before anything else.
log_level = opts.log_level