-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtpwd
54 lines (36 loc) · 1012 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
47
48
49
50
51
52
53
#!/usr/bin/env python
# -*- Python -*-
# -*- coding: utf-8 -*-
'''rtcshell
Copyright (C) 2009-2010
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
File: rtpwd
Command to show the current value of the current working directory environment
variable.
'''
# $Source$
#!/usr/bin/env python
# -*- Python -*-
# -*- coding: utf-8 -*-
import os
import sys
from rtcshell.path import ENV_VAR
def main(argv):
if len(argv) > 1 and (argv[1] == '--help' or argv[1] == '-h'):
print 'Print the name of the current rtcshell 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