diff --git a/lib/spack/spack/cmd/arch.py b/lib/spack/spack/cmd/arch.py index 1badd40f7f46a473ee69c78fcde22a4ba4c62832..4e29230c2889b284368600e903dbca4ad536038c 100644 --- a/lib/spack/spack/cmd/arch.py +++ b/lib/spack/spack/cmd/arch.py @@ -24,8 +24,18 @@ ############################################################################## import spack.architecture as architecture -description = "Print the architecture for this machine" +description = "Print architecture information about this machine." + + +def setup_parser(subparser): + parts = subparser.add_mutually_exclusive_group() + parts.add_argument( + '-p', '--platform', action='store_true', default=False, + help="Print only the platform.") def arch(parser, args): - print architecture.sys_type() + if args.platform: + print architecture.platform() + else: + print architecture.sys_type()