From 709b778904f0d1488f4ac323b42dee7d96f6b098 Mon Sep 17 00:00:00 2001 From: Stas Kelvich Date: Wed, 19 May 2021 12:32:57 +0300 Subject: [PATCH] Show help in CLI when no arguments provided --- pageserver/src/repository.rs | 1 - zenith/src/main.rs | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pageserver/src/repository.rs b/pageserver/src/repository.rs index b6cdb59770..3e6846def6 100644 --- a/pageserver/src/repository.rs +++ b/pageserver/src/repository.rs @@ -353,7 +353,6 @@ mod tests { /// "// CORRECT: " #[test] fn test_relsize() -> Result<()> { - // get_timeline() with non-existent timeline id should fail //repo.get_timeline("11223344556677881122334455667788"); diff --git a/zenith/src/main.rs b/zenith/src/main.rs index 1d461e811e..cccc2ffc3b 100644 --- a/zenith/src/main.rs +++ b/zenith/src/main.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, bail}; use anyhow::{Context, Result}; -use clap::{App, Arg, ArgMatches, SubCommand}; +use clap::{App, AppSettings, Arg, ArgMatches, SubCommand}; use control_plane::compute::ComputeControlPlane; use control_plane::local_env::{self, LocalEnv}; use control_plane::storage::PageServerNode; @@ -27,6 +27,7 @@ fn main() -> Result<()> { .required(true); let matches = App::new("zenith") + .setting(AppSettings::ArgRequiredElseHelp) .about("Zenith CLI") .subcommand( SubCommand::with_name("init") @@ -45,11 +46,12 @@ fn main() -> Result<()> { .arg(Arg::with_name("start-point").required(false).index(2)), ) .subcommand(SubCommand::with_name("status")) - .subcommand(SubCommand::with_name("start")) - .subcommand(SubCommand::with_name("stop")) - .subcommand(SubCommand::with_name("restart")) + .subcommand(SubCommand::with_name("start").about("Start local pageserver")) + .subcommand(SubCommand::with_name("stop").about("Stop local pageserver")) + .subcommand(SubCommand::with_name("restart").about("Restart local pageserver")) .subcommand( SubCommand::with_name("pg") + .setting(AppSettings::ArgRequiredElseHelp) .about("Manage postgres instances") .subcommand( SubCommand::with_name("create") @@ -65,6 +67,7 @@ fn main() -> Result<()> { ) .subcommand( SubCommand::with_name("remote") + .setting(AppSettings::ArgRequiredElseHelp) .about("Manage remote pagerservers") .subcommand( SubCommand::with_name("add")