sysmaster/backport-fix-make-the-help-information-clearer.patch
huyubiao 8936fa02c5 sync patches from upstream,change the path of the unit,modify permissions for some directories and files
(cherry picked from commit ce9ff469b57f60130621bc293783bd3ac1fc92f2)
2023-08-05 18:15:53 +08:00

169 lines
4.1 KiB
Diff

From 911a991c592cddda0dd7827e8d42277b1fda43cc Mon Sep 17 00:00:00 2001
From: licunlong <licunlong1@huawei.com>
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<String>,
},
- /// [units] stop the units
+ /// [unit] Reload one or more units
#[clap(display_order = 2)]
- Stop {
+ Reload {
#[clap(required = true)]
units: Vec<String>,
},
- /// [units] restart the units
+ /// [unit] Reset the failed state of one or more units
#[clap(display_order = 3)]
- Restart { units: Vec<String> },
+ ResetFailed {
+ #[clap(required = true)]
+ units: Vec<String>,
+ },
- /// [units] status of the units
+ /// [unit] Restart one or more units
#[clap(display_order = 4)]
- Status {
+ Restart {
#[clap(required = true)]
units: Vec<String>,
},
- /// [units] reload the units
+ /// [unit] Show the status of one or more units
#[clap(display_order = 5)]
- Reload {
+ Status {
#[clap(required = true)]
units: Vec<String>,
},
- /// [units] isolate the units
- Isolate {
+ /// [unit] Start one or more units
+ #[clap(display_order = 6)]
+ Start {
#[clap(required = true)]
units: Vec<String>,
},
- /// [units] reset the failed units
- ResetFailed {
+ /// [unit] Stop one or more units
+ #[clap(display_order = 7)]
+ Stop {
#[clap(required = true)]
units: Vec<String>,
},
- /// [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<String>,
},
- /// enable one unit file
+ /// [unit-file] Disable one or more units
+ #[clap(display_order = 16)]
Disable {
#[clap(required = true)]
unit_file: Vec<String>,
},
- // mask one unit file
+ /// [unit-file] Mask one or more units
+ #[clap(display_order = 17)]
Mask {
#[clap(required = true)]
unit_file: Vec<String>,
},
- // unmask one unit file
+ /// [unit-file] Unmask one or more units
+ #[clap(display_order = 18)]
Unmask {
#[clap(required = true)]
unit_file: Vec<String>,
--
2.33.0