summaryrefslogtreecommitdiff
path: root/lib/spack/spack/util/executable.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/util/executable.py')
-rw-r--r--lib/spack/spack/util/executable.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py
index 1d7f019fdf..44865e7bdb 100644
--- a/lib/spack/spack/util/executable.py
+++ b/lib/spack/spack/util/executable.py
@@ -53,8 +53,31 @@ class Executable(object):
@property
def command(self):
+ """The command-line string.
+
+ Returns:
+ str: The executable and default arguments
+ """
return ' '.join(self.exe)
+ @property
+ def name(self):
+ """The executable name.
+
+ Returns:
+ str: The basename of the executable
+ """
+ return os.path.basename(self.path)
+
+ @property
+ def path(self):
+ """The path to the executable.
+
+ Returns:
+ str: The path to the executable
+ """
+ return self.exe[0]
+
def __call__(self, *args, **kwargs):
"""Run this executable in a subprocess.