From b9626229751ff91299b2a4adfb3df1c2b2529dc0 Mon Sep 17 00:00:00 2001
From: Todd Gamblin <tgamblin@llnl.gov>
Date: Sun, 30 Oct 2016 15:40:11 -0700
Subject: [PATCH] Add `spack arch --platform` option

---
 lib/spack/spack/cmd/arch.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/spack/spack/cmd/arch.py b/lib/spack/spack/cmd/arch.py
index 1badd40f7f..4e29230c28 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()
-- 
GitLab