mirror of
https://gitlab.com/Nanolx/qwad.git
synced 2024-11-22 02:29:18 +01:00
add command-line parser to Qwad,
currently only --help and --version
This commit is contained in:
parent
af23c01708
commit
56e994f31e
18
Qwad.pyw
18
Qwad.pyw
@ -1,10 +1,24 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
#-*- coding: utf-8 -*-
|
#coding=utf-8
|
||||||
import sys
|
import sys
|
||||||
|
import optparse
|
||||||
from PyQt4.QtGui import QApplication
|
from PyQt4.QtGui import QApplication
|
||||||
from PyQt4.QtCore import QTranslator, QString, QLocale
|
from PyQt4.QtCore import QTranslator, QString, QLocale
|
||||||
from GUI.VenPri import MWQwad
|
from GUI.VenPri import MWQwad
|
||||||
|
|
||||||
|
parser = optparse.OptionParser("qwad <option> [value]\
|
||||||
|
\n\nQwad (c) 2012 Christopher Roy Bratusek\
|
||||||
|
\nLicensed under the GNU GENERAL PUBLIC LICENSE v3")
|
||||||
|
|
||||||
|
parser.add_option("-v", "--version", dest="version",
|
||||||
|
action="store_true", default=False, help="print version and exit")
|
||||||
|
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if options.version:
|
||||||
|
print "0.6"
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
translator = QTranslator()
|
translator = QTranslator()
|
||||||
translator.load(QString("i18n/Qwad_%1").arg(QLocale.system().name()))
|
translator.load(QString("i18n/Qwad_%1").arg(QLocale.system().name()))
|
||||||
|
Loading…
Reference in New Issue
Block a user