diff options
author | Ben Boeckel <mathstuf@users.noreply.github.com> | 2016-04-23 16:34:51 -0400 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-04-23 13:34:51 -0700 |
commit | ed16bd133afd4c4da48f9d92e0d8578fd3719c72 (patch) | |
tree | 00d3b682da5c5e86049871844650d0c122574871 /lib | |
parent | 22e4ee560465a633f7dd8e84a2e7088d8dcf547f (diff) | |
download | spack-ed16bd133afd4c4da48f9d92e0d8578fd3719c72.tar.gz spack-ed16bd133afd4c4da48f9d92e0d8578fd3719c72.tar.bz2 spack-ed16bd133afd4c4da48f9d92e0d8578fd3719c72.tar.xz spack-ed16bd133afd4c4da48f9d92e0d8578fd3719c72.zip |
compiler: add "find" subcommand (#818)
And make "add" an alias to it.
Fixes #713.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/compiler.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py index 3e58e82184..a8e9e2a7a5 100644 --- a/lib/spack/spack/cmd/compiler.py +++ b/lib/spack/spack/cmd/compiler.py @@ -44,10 +44,10 @@ def setup_parser(subparser): scopes = spack.config.config_scopes - # Add - add_parser = sp.add_parser('add', help='Add compilers to the Spack configuration.') - add_parser.add_argument('add_paths', nargs=argparse.REMAINDER) - add_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope, + # Find + find_parser = sp.add_parser('find', aliases=['add'], help='Search the system for compilers to add to the Spack configuration.') + find_parser.add_argument('add_paths', nargs=argparse.REMAINDER) + find_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope, help="Configuration scope to modify.") # Remove @@ -70,7 +70,7 @@ def setup_parser(subparser): help="Configuration scope to read from.") -def compiler_add(args): +def compiler_find(args): """Search either $PATH or a list of paths for compilers and add them to Spack's configuration.""" paths = args.add_paths @@ -136,7 +136,8 @@ def compiler_list(args): def compiler(parser, args): - action = { 'add' : compiler_add, + action = { 'add' : compiler_find, + 'find' : compiler_find, 'remove' : compiler_remove, 'rm' : compiler_remove, 'info' : compiler_info, |