1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-07 18:30:54 +00:00

Version management, next version is 0.3.

This commit is contained in:
Guillaume Ayoub 2010-05-31 00:49:52 +02:00
parent dbe614552a
commit 054950be54
4 changed files with 22 additions and 5 deletions

View file

@ -43,6 +43,10 @@ import radicale
# Get command-line options
parser = optparse.OptionParser()
parser.add_option(
"-v", "--version", action="store_true",
default=False,
help="show version and exit")
parser.add_option(
"-d", "--daemon", action="store_true",
default=radicale.config.getboolean("server", "daemon"),
@ -76,6 +80,11 @@ for option in parser.option_list:
value = getattr(options, key)
radicale.config.set("server", key, value)
# Print version and exit if the option is given
if options.version:
print(radicale.VERSION)
sys.exit()
# Fork if Radicale is launched as daemon
if options.daemon:
if os.fork():