Command-line argument -c --> -f
This commit is contained in:
parent
330721480f
commit
165a35a471
|
@ -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
|
the hub its primary ("canonical") *host name* and *port number*. These
|
||||||
are used to build URLs for clients of the Hub to use.
|
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
|
it loads configuration data from the named file. The option can be
|
||||||
supplied more than once; all named files are imported.
|
supplied more than once; all named files are imported.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#lang syndicate/actor
|
#lang syndicate/actor
|
||||||
|
|
||||||
(require racket/cmdline)
|
(require racket/cmdline)
|
||||||
|
(require racket/port)
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
|
|
||||||
(require "private/util.rkt")
|
(require "private/util.rkt")
|
||||||
|
@ -21,7 +22,11 @@
|
||||||
(assert (config (list 'canonical-host host (string->number port)))))]
|
(assert (config (list 'canonical-host host (string->number port)))))]
|
||||||
|
|
||||||
#:multi
|
#: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)])
|
(spawn-configuration filename)])
|
||||||
|
|
||||||
(actor #:name 'main
|
(actor #:name 'main
|
||||||
|
|
|
@ -6,4 +6,4 @@ set -e
|
||||||
echo "Starting RacketMQ"
|
echo "Starting RacketMQ"
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
export PLTSTDERR="$PLTSTDERR debug@racketmq info@syndicate/drivers/web error"
|
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
|
||||||
|
|
Loading…
Reference in New Issue