#!/usr/bin/env python
# -*- Python -*-
# -*- coding: utf-8 -*-

'''rtshell

Copyright (C) 2009-2014
    Geoffrey Biggs
    RT-Synthesis Research Group
    Intelligent Systems Research Institute,
    National Institute of Advanced Industrial Science and Technology (AIST),
    Japan
    All rights reserved.
Licensed under the Eclipse Public License -v 1.0 (EPL)
http://www.opensource.org/licenses/eclipse-1.0.txt

Command to show the current value of the current working directory environment
variable.

'''


import os
import sys


from rtshell.path import ENV_VAR


def main(argv):
    if len(argv) > 1 and (argv[1] == '--help' or argv[1] == '-h'):
        print >>sys.stderr, \
                'Print the name of the current rtshell working directory.'
        return 0
    if ENV_VAR in os.environ:
        print os.environ[ENV_VAR]
    else:
        print '/'
    return 0


if __name__ == '__main__':
    sys.exit(main(sys.argv))


# vim: tw=79

