public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:master commit in: catalyst/, bin/
@ 2015-11-23 12:06 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2015-11-23 12:06 UTC (permalink / raw
  To: gentoo-commits

commit:     b7397ef293137c1451d5366fc29f7a9dd1fd808a
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 23 11:38:24 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 11:38:24 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b7397ef2

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.

 bin/catalyst     | 2 +-
 catalyst/main.py | 4 ++--
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-23 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 12:06 [gentoo-commits] proj/catalyst:master commit in: catalyst/, bin/ Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox