mirror of
https://github.com/2e3s/awatcher.git
synced 2025-06-05 19:15:33 +00:00
Add --testing option to CLI
This commit is contained in:
parent
5b8c90a69c
commit
52307b1d13
@ -78,6 +78,10 @@ pub fn from_cli() -> anyhow::Result<RunnerConfig> {
|
|||||||
.short('v')
|
.short('v')
|
||||||
.help("Verbosity level: -v for warnings, -vv for info, -vvv for debug, -vvvv for trace")
|
.help("Verbosity level: -v for warnings, -vv for info, -vvv for debug, -vvvv for trace")
|
||||||
.action(ArgAction::Count),
|
.action(ArgAction::Count),
|
||||||
|
#[cfg(not(feature = "bundle"))]
|
||||||
|
arg!(--"testing" "Use the testing port instead")
|
||||||
|
.value_parser(value_parser!(bool))
|
||||||
|
.action(ArgAction::SetTrue),
|
||||||
])
|
])
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
@ -94,7 +98,10 @@ pub fn from_cli() -> anyhow::Result<RunnerConfig> {
|
|||||||
|
|
||||||
Ok(RunnerConfig {
|
Ok(RunnerConfig {
|
||||||
watchers_config: Config {
|
watchers_config: Config {
|
||||||
|
#[cfg(feature = "bundle")]
|
||||||
port: config.server.port,
|
port: config.server.port,
|
||||||
|
#[cfg(not(feature = "bundle"))]
|
||||||
|
port: if *matches.get_one("testing").unwrap() { 5666 } else { config.server.port },
|
||||||
host: config.server.host,
|
host: config.server.host,
|
||||||
idle_timeout: config.client.get_idle_timeout(),
|
idle_timeout: config.client.get_idle_timeout(),
|
||||||
poll_time_idle: config.client.get_poll_time_idle(),
|
poll_time_idle: config.client.get_poll_time_idle(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user