From c4159cba5836083dc2be2b5396cbf85319d31768 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 12 Oct 2013 11:56:22 +0200 Subject: add --copying and --version --- src/gpp.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) 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 . +''' +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 .') + sys.exit(0) else: continue i += 1 -- cgit v1.2.3-70-g09d2