diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/arch.py | 18 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/arch.py | 10 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/arch.py b/lib/spack/spack/cmd/arch.py index f3208ec5c0..707a91cc2a 100644 --- a/lib/spack/spack/cmd/arch.py +++ b/lib/spack/spack/cmd/arch.py @@ -14,6 +14,7 @@ level = "short" def setup_parser(subparser): parts = subparser.add_mutually_exclusive_group() + parts2 = subparser.add_mutually_exclusive_group() parts.add_argument( '-p', '--platform', action='store_true', default=False, help='print only the platform') @@ -23,11 +24,24 @@ def setup_parser(subparser): parts.add_argument( '-t', '--target', action='store_true', default=False, help='print only the target') + parts2.add_argument( + '-f', '--frontend', action='store_true', default=False, + help='print frontend') + parts2.add_argument( + '-b', '--backend', action='store_true', default=False, + help='print backend') def arch(parser, args): - arch = architecture.Arch( - architecture.platform(), 'default_os', 'default_target') + if args.frontend: + arch = architecture.Arch(architecture.platform(), + 'frontend', 'frontend') + elif args.backend: + arch = architecture.Arch(architecture.platform(), + 'backend', 'backend') + else: + arch = architecture.Arch(architecture.platform(), + 'default_os', 'default_target') if args.platform: print(arch.platform) diff --git a/lib/spack/spack/test/cmd/arch.py b/lib/spack/spack/test/cmd/arch.py index 15ab7f2474..43c1433a51 100644 --- a/lib/spack/spack/test/cmd/arch.py +++ b/lib/spack/spack/test/cmd/arch.py @@ -13,6 +13,10 @@ def test_arch(): """Sanity check ``spack arch`` to make sure it works.""" arch() + arch('-f') + arch('--frontend') + arch('-b') + arch('--backend') def test_arch_platform(): @@ -20,6 +24,8 @@ def test_arch_platform(): arch('-p') arch('--platform') + arch('-f', '-p') + arch('-b', '-p') def test_arch_operating_system(): @@ -27,6 +33,8 @@ def test_arch_operating_system(): arch('-o') arch('--operating-system') + arch('-f', '-o') + arch('-b', '-o') def test_arch_target(): @@ -34,3 +42,5 @@ def test_arch_target(): arch('-t') arch('--target') + arch('-f', '-t') + arch('-b', '-t') |