-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrtpwd
executable file
·47 lines (32 loc) · 952 Bytes
/
rtpwd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/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