Commits

Eric Larson committed 05211cd Draft

Added an id command to help see where the current xenv is. This is helpful when you want to verify you are using the right xenv

Comments (0)

Files changed (1)

 This defines the main 'xe' entry point to the xenv. Below, the parser
 definition describes the usage and UI for interacting with an xenv.
 '''
+from __future__ import print_function
 import os
 import sys
 
 
 
 @with_root
+def identity(xenv, args):
+    print('ROOT:', xenv.root)
+
+
+@with_root
 def run_cmd(xenv, args):
     xenv.run(args.cmd.pop())
 
         create.add_argument('root', help='The root of the xenv')
         create.set_defaults(func=create_xenv_cmd)
 
+        # Check where the current xe is
+        ident = self.subs.add_parser('id', help='Get info on the current xenv')
+        ident.set_defaults(func=identity)
+
         # run a command via the xenv
         run = self.subs.add_parser('run', prefix_chars='!',
                                    help='Run a command from the xenv')