From 4c2b2c2fe7e77a15142ca8b4f8828959d44935c1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 12 Oct 2013 12:14:50 +0200 Subject: add --export --- src/gpp.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v1.2.3-70-g09d2