From 44cc3457afa63ea25494fc4f27f0e59be677a1c6 Mon Sep 17 00:00:00 2001 From: yukang Date: Tue, 12 Dec 2023 11:48:11 +0800 Subject: [PATCH] windows will not have deamon option --- util/app-config/src/cli.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/util/app-config/src/cli.rs b/util/app-config/src/cli.rs index e4095cb060..436ee4b7fc 100644 --- a/util/app-config/src/cli.rs +++ b/util/app-config/src/cli.rs @@ -173,7 +173,7 @@ pub fn get_bin_name_and_matches(version: &Version) -> (String, ArgMatches) { } fn run() -> Command { - Command::new(CMD_RUN) + let command = Command::new(CMD_RUN) .about("Run CKB node") .arg( Arg::new(ARG_BA_ADVANCED) @@ -181,13 +181,6 @@ fn run() -> Command { .action(clap::ArgAction::SetTrue) .help("Allow any block assembler code hash and args"), ) - .arg( - Arg::new(ARG_DAEMON) - .long(ARG_DAEMON) - .action(clap::ArgAction::SetTrue) - .help("Starts ckb as a daemon, \ - which will run in the background and output logs to the specified log file"), - ) .arg( Arg::new(ARG_SKIP_CHAIN_SPEC_CHECK) .long(ARG_SKIP_CHAIN_SPEC_CHECK) @@ -217,7 +210,19 @@ fn run() -> Command { .long(ARG_INDEXER) .action(clap::ArgAction::SetTrue) .help("Start the built-in indexer service"), - ) + ); + + #[cfg(not(target_os = "windows"))] + let command = command.arg( + Arg::new(ARG_DAEMON) + .long(ARG_DAEMON) + .action(clap::ArgAction::SetTrue) + .help( + "Starts ckb as a daemon, \ + which will run in the background and output logs to the specified log file", + ), + ); + command } fn miner() -> Command {