From 9634e97a3ae80b50a538179d7aecd756cbb4cc23 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Sun, 11 Aug 2024 12:06:36 -0500 Subject: [PATCH] feat: Add emojis and improve help output for ghostkey command --- rust/cli/src/bin/ghostkey.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rust/cli/src/bin/ghostkey.rs b/rust/cli/src/bin/ghostkey.rs index dfc4fbb8..12b38189 100644 --- a/rust/cli/src/bin/ghostkey.rs +++ b/rust/cli/src/bin/ghostkey.rs @@ -37,10 +37,11 @@ fn main() { } fn run() -> i32 { - let matches = Command::new("Freenet Ghost Key Utility") + let matches = Command::new("👻🔑 Freenet Ghost Key Utility") .version(env!("CARGO_PKG_VERSION")) .author("Ian Clarke ") .about("Utility for generating and verifying Freenet ghost keys") + .after_help("Run 'ghostkey -h' for more information on a specific command.") .subcommand( Command::new(CMD_VERIFY_GHOST_KEY) .about("Verifies a ghost certificate") @@ -59,6 +60,8 @@ fn run() -> i32 { .value_name("FILE"), ), ) + .subcommand_required(true) + .arg_required_else_help(true) .subcommand( Command::new(CMD_GENERATE_MASTER_KEY) .about("Generate a new master keypair") @@ -386,7 +389,12 @@ fn run() -> i32 { verify_signed_message_cmd(signed_message_file, &master_verifying_key, output_file) } _ => { - info!("No valid subcommand provided. Use --help for usage information."); + println!("👻🔑 Welcome to the Freenet Ghost Key Utility!"); + println!("Use 'ghostkey -h' for detailed usage information."); + println!("Available commands:"); + for (name, cmd) in matches.get_subcommands() { + println!(" {} - {}", name, cmd.get_about().unwrap_or("")); + } 0 } }