aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-10-12 12:14:50 +0200
committerMattias Andrée <maandree@operamail.com>2013-10-12 12:14:50 +0200
commit4c2b2c2fe7e77a15142ca8b4f8828959d44935c1 (patch)
treecab72c60a3a026dc1fa9a82b0977a549e24037cc
parentadd --copying and --version (diff)
downloadgpp-4c2b2c2fe7e77a15142ca8b4f8828959d44935c1.tar.gz
gpp-4c2b2c2fe7e77a15142ca8b4f8828959d44935c1.tar.bz2
gpp-4c2b2c2fe7e77a15142ca8b4f8828959d44935c1.tar.xz
add --export
-rwxr-xr-xsrc/gpp.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpp.py b/src/gpp.py
index d6fdf5e..6881d98 100755
--- a/src/gpp.py
+++ b/src/gpp.py
@@ -52,6 +52,12 @@ for i in range(1, len(args)):
elif arg in ('-f', '--file'):
input_file = sys.argv[i]
output_file = sys.argv[i]
+ elif arg in ('-D', '--export'):
+ export = sys.argv[i]
+ if '=' not in export:
+ export += '=1'
+ export = (export.split('=')[0], '='.join(export.split('=')[1:]))
+ os.putenv(export[0], export[1])
elif arg in ('-v', '--version'):
print('gpp ' + VERSION)
sys.exit(0)