cli_rs: explicit annotation of subcommand help text

Summary:
Comments affecting runtime behavior disturbs me, so use explicit
structopt annotations on help text. And move those annotations to the
command implementations.

Reviewed By: fanzeyi

Differential Revision: D26412452

fbshipit-source-id: 066dfdd1c54254bae4bd2af65031487b7a1094da
This commit is contained in:
Chad Austin 2021-02-22 14:09:48 -08:00 committed by Facebook GitHub Bot
parent 89ab1a37b7
commit 2e0e5ee0ea
4 changed files with 3 additions and 5 deletions

View File

@ -59,14 +59,9 @@ pub struct Command {
#[derive(StructOpt, Debug)]
pub enum SubCommand {
/// Check the health of the Eden service
#[structopt(alias = "health")]
Status(crate::status::StatusCmd),
/// Print the daemon's process ID if running
Pid(crate::pid::PidCmd),
/// Determine uptime of running edenfs daemon
Uptime(crate::uptime::UptimeCmd),
}

View File

@ -15,6 +15,7 @@ use edenfs_client::EdenFsInstance;
use crate::ExitCode;
#[derive(StructOpt, Debug)]
#[structopt(about = "Print the daemon's process ID if running")]
pub struct PidCmd {}
impl PidCmd {

View File

@ -17,6 +17,7 @@ use edenfs_client::{DaemonHealthy, EdenFsInstance};
use crate::ExitCode;
#[derive(StructOpt, Debug)]
#[structopt(about = "Check the health of the Eden service")]
pub struct StatusCmd {
/// Wait up to TIMEOUT seconds for the daemon to respond
#[structopt(long, default_value = "3")]

View File

@ -17,6 +17,7 @@ use edenfs_client::{DaemonHealthy, EdenFsInstance};
use crate::ExitCode;
#[derive(StructOpt, Debug)]
#[structopt(about = "Determine uptime of running edenfs daemon")]
pub struct UptimeCmd {}
struct HumanTime {