From 911a991c592cddda0dd7827e8d42277b1fda43cc Mon Sep 17 00:00:00 2001 From: licunlong Date: Tue, 11 Jul 2023 20:40:39 +0800 Subject: [PATCH] fix: make the help information clearer --- core/sctl/main.rs | 82 ++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/core/sctl/main.rs b/core/sctl/main.rs index 664db62..10e9ae8 100644 --- a/core/sctl/main.rs +++ b/core/sctl/main.rs @@ -36,102 +36,118 @@ struct Args { #[derive(Parser, Debug)] enum SubCmd { - /// [units] start the units + /// [unit] Isolate one or more units #[clap(display_order = 1)] - Start { + Isolate { #[clap(required = true)] units: Vec, }, - /// [units] stop the units + /// [unit] Reload one or more units #[clap(display_order = 2)] - Stop { + Reload { #[clap(required = true)] units: Vec, }, - /// [units] restart the units + /// [unit] Reset the failed state of one or more units #[clap(display_order = 3)] - Restart { units: Vec }, + ResetFailed { + #[clap(required = true)] + units: Vec, + }, - /// [units] status of the units + /// [unit] Restart one or more units #[clap(display_order = 4)] - Status { + Restart { #[clap(required = true)] units: Vec, }, - /// [units] reload the units + /// [unit] Show the status of one or more units #[clap(display_order = 5)] - Reload { + Status { #[clap(required = true)] units: Vec, }, - /// [units] isolate the units - Isolate { + /// [unit] Start one or more units + #[clap(display_order = 6)] + Start { #[clap(required = true)] units: Vec, }, - /// [units] reset the failed units - ResetFailed { + /// [unit] Stop one or more units + #[clap(display_order = 7)] + Stop { #[clap(required = true)] units: Vec, }, - /// [manager] list all units + /// [manager] Reload sysmaster manager configuration + #[clap(display_order = 8)] + DaemonReload {}, + + /// [manager] Reexecute sysmaster manager + #[clap(display_order = 9)] + DaemonReexec {}, + + /// [manager] List all units + #[clap(display_order = 10)] ListUnits {}, - /// [system] shutdown the system - Shutdown { + /// [system] Halt the system + #[clap(display_order = 11)] + Halt { #[clap(short, required = false)] force: bool, }, - /// [system] reboot the system - Reboot { + /// [system] Poweroff the system + #[clap(display_order = 12)] + Poweroff { #[clap(short, required = false)] force: bool, }, - /// [system] halt the system - Halt { + /// [system] Reboot the system + #[clap(display_order = 13)] + Reboot { #[clap(short, required = false)] force: bool, }, - /// [system] poweroff the system - Poweroff { + /// [system] Shutdown the system + #[clap(display_order = 14)] + Shutdown { #[clap(short, required = false)] force: bool, }, - /// [manager] Reload sysmaster manager configuration - DaemonReload {}, - - /// [manager] Reexecute sysmaster manager - DaemonReexec {}, - - /// enable one unit file + /// [unit-file] Enable one or more units + #[clap(display_order = 15)] Enable { #[clap(required = true)] unit_file: Vec, }, - /// enable one unit file + /// [unit-file] Disable one or more units + #[clap(display_order = 16)] Disable { #[clap(required = true)] unit_file: Vec, }, - // mask one unit file + /// [unit-file] Mask one or more units + #[clap(display_order = 17)] Mask { #[clap(required = true)] unit_file: Vec, }, - // unmask one unit file + /// [unit-file] Unmask one or more units + #[clap(display_order = 18)] Unmask { #[clap(required = true)] unit_file: Vec, -- 2.33.0