diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-01-05 02:33:15 -0500 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-01-05 02:33:15 -0500 |
commit | 935eba23579af1d64e56fea38ab981846e127645 (patch) | |
tree | a04a7a70f4a15d153f8b737226ae7b942e07b052 /lib | |
parent | 5d033fbd0aed96770bd6802dbece6df1a5c8540e (diff) | |
download | spack-935eba23579af1d64e56fea38ab981846e127645.tar.gz spack-935eba23579af1d64e56fea38ab981846e127645.tar.bz2 spack-935eba23579af1d64e56fea38ab981846e127645.tar.xz spack-935eba23579af1d64e56fea38ab981846e127645.zip |
Allow commands to return error codes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/graph.py | 5 | ||||
-rw-r--r-- | lib/spack/spack/cmd/md5.py | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/spack/spack/cmd/graph.py b/lib/spack/spack/cmd/graph.py index f8cd18d91f..cb93a1b543 100644 --- a/lib/spack/spack/cmd/graph.py +++ b/lib/spack/spack/cmd/graph.py @@ -31,6 +31,8 @@ from spack.graph import * description = "Generate graphs of package dependency relationships." def setup_parser(subparser): + setup_parser.parser = subparser + method = subparser.add_mutually_exclusive_group() method.add_argument( '--ascii', action='store_true', @@ -50,6 +52,9 @@ def graph(parser, args): specs = spack.cmd.parse_specs( args.specs, normalize=True, concretize=args.concretize) + if not specs: + setup_parser.parser.print_help() + return 1 if args.dot: # Dot graph only if asked for. graph_dot(*specs) diff --git a/lib/spack/spack/cmd/md5.py b/lib/spack/spack/cmd/md5.py index 496835c64b..dfa1be412b 100644 --- a/lib/spack/spack/cmd/md5.py +++ b/lib/spack/spack/cmd/md5.py @@ -41,6 +41,7 @@ def setup_parser(subparser): def md5(parser, args): if not args.files: setup_parser.parser.print_help() + return 1 for f in args.files: if not os.path.isfile(f): |