Smallish fixes for argparser

master
Gina Häußge 2013-03-11 21:04:56 +01:00
parent 363f00775b
commit b7a3105655
2 changed files with 8 additions and 9 deletions

View File

@ -52,9 +52,9 @@ Alternatively, the host and port on which to bind can be defined via the configu
If you want to run OctoPrint as a daemon (only supported on Linux), use
./run --daemon {start|stop|restart} [--pidfile PIDFILE]
./run --daemon {start|stop|restart} [--pid PIDFILE]
If you do not supply a custom pidfile location via `--pidfile PIDFILE`, it will be created at `/tmp/octoprint.pid`.
If you do not supply a custom pidfile location via `--pid PIDFILE`, it will be created at `/tmp/octoprint.pid`.
You can also specify the configfile or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders),
e.g.:

13
run
View File

@ -47,13 +47,12 @@ def main():
sys.exit(2)
daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug)
if args.command is not None:
if "start" == args.command:
daemon.start()
elif "stop" == args.command:
daemon.stop()
elif "restart" == args.command:
daemon.restart()
if "start" == args.command:
daemon.start()
elif "stop" == args.command:
daemon.stop()
elif "restart" == args.command:
daemon.restart()
else:
octoprint = Server(args.config, args.basedir, args.host, args.port, args.debug)
octoprint.run()