wylark
/
infoex-autowx.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement --version switch
[infoex-autowx.git]
/
infoex-autowx.py
diff --git
a/infoex-autowx.py
b/infoex-autowx.py
index 78c4d49be685bd86719fa0ccbc7651b681c8bbf3..442376bafcd703ab288cfe3150947c5e3157365b 100755
(executable)
--- a/
infoex-autowx.py
+++ b/
infoex-autowx.py
@@
-42,6
+42,8
@@
import zeep
import zeep.cache
import zeep.transports
import zeep.cache
import zeep.transports
+__version__ = '2.0.0'
+
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
@@
-69,10
+71,20
@@
parser.add_option("--dry-run",
default=False,
help="fetch data but don't upload to InfoEx")
default=False,
help="fetch data but don't upload to InfoEx")
+parser.add_option("--version",
+ action="store_true",
+ dest="show_version",
+ default=False,
+ help="show program version and exit")
+
(options, args) = parser.parse_args()
config = configparser.ConfigParser(allow_no_value=False)
(options, args) = parser.parse_args()
config = configparser.ConfigParser(allow_no_value=False)
+if options.show_version:
+ print("%s - %s" % (os.path.basename(__file__), __version__))
+ sys.exit(0)
+
if not options.config:
print("Please specify a configuration file via --config.")
sys.exit(1)
if not options.config:
print("Please specify a configuration file via --config.")
sys.exit(1)