Added --license switch to the Gui.

This commit is contained in:
Cas Cremers 2007-10-08 14:52:50 +02:00
parent 9d4ce4ecc1
commit 6e65138dca
2 changed files with 21 additions and 0 deletions

View File

@ -409,6 +409,18 @@ def GetInfo(html=False):
return html
def GetLicense():
"""
Retrieve license information.
"""
program = getScytherBackend()
arg = "--license"
sc = Scyther()
(output,errors) = sc.doScytherCommand(spdl=None, args=arg)
return output
#---------------------------------------------------------------------------
# vim: set ts=4 sw=4 et list lcs=tab\:>-:

View File

@ -63,6 +63,10 @@ def parseArgs():
parser.add_option("-c","--check",dest="command",default=None,action="store_const",const="check",
help="Immediately check protocol (requires input file)")
# License
parser.add_option("-l","--license",dest="license",default=False,action="store_const",const=True,
help="Show license")
# no-splash
parser.add_option("-N","--no-splash",dest="splashscreen",default=True,action="store_const",const=False,
help="Do not show the splash screen")
@ -123,6 +127,11 @@ class ScytherApp(wx.App):
basedir = os.path.abspath(os.path.dirname(sys.argv[0]))
(opts,args) = parseArgs()
# License option may abort here
if opts.license:
print Scyther.GetLicense()
sys.exit(0)
# Load preferences file
Preference.init()