@@ -27,15 +27,18 @@ function collect(val, memo) {
2727}
2828
2929const defaultCacheModule = config . get ( "Cache.defaultModule" ) ;
30+ const defaultCachePort = config . has ( 'Cache.port' ) ? config . get ( 'Cache.port' ) : consts . DEFAULT_PORT ;
31+ const defaultLogLevel = config . has ( 'Cache.log-level' ) ? config . get ( 'Cache.log-level' ) : consts . DEFAULT_LOG_LEVEL ;
32+ const defaultWorkers = config . has ( 'Cache.workers' ) ? config . get ( 'Cache.workers' ) : consts . DEFAULT_WORKERS
3033
3134program . description ( "Unity Cache Server" )
3235 . version ( VERSION )
3336 . allowUnknownOption ( true )
34- . option ( '-p, --port <n>' , 'Specify the server port, only apply to new cache server' , myParseInt , consts . DEFAULT_PORT )
37+ . option ( '-p, --port <n>' , 'Specify the server port, only apply to new cache server' , myParseInt , defaultCachePort )
3538 . option ( '-c --cache-module [path]' , 'Use cache module at specified path' , defaultCacheModule )
3639 . option ( '-P, --cache-path [path]' , 'Specify the path of the cache directory' )
37- . option ( '-l, --log-level <n>' , 'Specify the level of log verbosity. Valid values are 0 (silent) through 5 (debug)' , myParseInt , consts . DEFAULT_LOG_LEVEL )
38- . option ( '-w, --workers <n>' , 'Number of worker threads to spawn' , zeroOrMore , consts . DEFAULT_WORKERS )
40+ . option ( '-l, --log-level <n>' , 'Specify the level of log verbosity. Valid values are 0 (silent) through 5 (debug)' , myParseInt , defaultLogLevel )
41+ . option ( '-w, --workers <n>' , 'Number of worker threads to spawn' , zeroOrMore , defaultWorkers )
3942 . option ( '-m --mirror [host:port]' , 'Mirror transactions to another cache server. Can be repeated for multiple mirrors' , collect , [ ] )
4043 . option ( '--dump-config' , 'Write the active configuration to the console' )
4144 . option ( '--save-config [path]' , 'Write the active configuration to the specified file and exit. Defaults to ./default.yml' )
0 commit comments