Command-line argument -c --> -f

This commit is contained in:
Tony Garnock-Jones 2016-11-21 17:04:44 +13:00
parent 330721480f
commit 165a35a471
3 changed files with 8 additions and 3 deletions

View File

@ -49,7 +49,7 @@ RacketMQ has only one required configuration variable: you must tell
the hub its primary ("canonical") *host name* and *port number*. These
are used to build URLs for clients of the Hub to use.
When the RacketMQ startup script is given a "`-c` *filename*" option,
When the RacketMQ startup script is given a "`-f` *filename*" option,
it loads configuration data from the named file. The option can be
supplied more than once; all named files are imported.

View File

@ -1,6 +1,7 @@
#lang syndicate/actor
(require racket/cmdline)
(require racket/port)
(require racket/set)
(require "private/util.rkt")
@ -21,7 +22,11 @@
(assert (config (list 'canonical-host host (string->number port)))))]
#:multi
[("-c" "--config") filename "Specify a configuration file to load"
[("-o" "--option") key vals "Specify a single configuration option"
(actor #:name (list 'config-option key vals)
(assert (config (cons (string->symbol key)
(port->list read (open-input-string vals))))))]
[("-f" "--config-file") filename "Specify a configuration file to load"
(spawn-configuration filename)])
(actor #:name 'main

View File

@ -6,4 +6,4 @@ set -e
echo "Starting RacketMQ"
exec 2>&1
export PLTSTDERR="$PLTSTDERR debug@racketmq info@syndicate/drivers/web error"
exec racket hub.rkt -c live-config.rktd
exec racket hub.rkt -f live-config.rktd