aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpp.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-10-12 11:56:22 +0200
committerMattias Andrée <maandree@operamail.com>2013-10-12 11:56:22 +0200
commitc4159cba5836083dc2be2b5396cbf85319d31768 (patch)
tree48918cce2cfb22f0baaf1a414e893e4117a8f048 /src/gpp.py
parentdo not obmit, white out the shebang line (diff)
downloadgpp-c4159cba5836083dc2be2b5396cbf85319d31768.tar.gz
gpp-c4159cba5836083dc2be2b5396cbf85319d31768.tar.bz2
gpp-c4159cba5836083dc2be2b5396cbf85319d31768.tar.xz
add --copying and --version
Diffstat (limited to '')
-rwxr-xr-xsrc/gpp.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gpp.py b/src/gpp.py
index f5be2df..d6fdf5e 100755
--- a/src/gpp.py
+++ b/src/gpp.py
@@ -1,4 +1,23 @@
#!/usr/bin/env python3
+'''
+gpp – Bash based general purpose preprocessor
+
+Copyright © 2013 Mattias Andrée (maandree@member.fsf.org)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+'''
+VERSION="@{VERSION}"
import os
import sys
@@ -33,6 +52,27 @@ 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 ('-v', '--version'):
+ print('gpp ' + VERSION)
+ sys.exit(0)
+ elif arg in ('-c', '--copying'):
+ print('gpp – Bash based general purpose preprocessor')
+ print('')
+ print('Copyright © 2013 Mattias Andrée (maandree@member.fsf.org)')
+ print('')
+ print('This program is free software: you can redistribute it and/or modify')
+ print('it under the terms of the GNU General Public License as published by')
+ print('the Free Software Foundation, either version 3 of the License, or')
+ print('(at your option) any later version.')
+ print('')
+ print('This program is distributed in the hope that it will be useful,')
+ print('but WITHOUT ANY WARRANTY; without even the implied warranty of')
+ print('MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the')
+ print('GNU General Public License for more details.')
+ print('')
+ print('You should have received a copy of the GNU General Public License')
+ print('along with this program. If not, see <http://www.gnu.org/licenses/>.')
+ sys.exit(0)
else:
continue
i += 1