From c5e962ef43a4b5e1559527a18a6490df7822225d Mon Sep 17 00:00:00 2001 From: materus Date: Thu, 14 Mar 2024 19:59:33 +0100 Subject: [PATCH] Update help text variable names --- README.md | 21 ++++++++++----------- src/main.rs | 5 ++++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d827598..5c4bb31 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,20 @@ currency-exchange --interactive ``` More information on usage: ``` -Usage: currency-exchange [OPTIONS] [CURRENCY_FROM] [CURRENCY_TO] [VALUE] +Usage: currency-exchange [OPTIONS] [Currency input] [Currency target] [Amount] Arguments: - [CURRENCY_FROM] Currency code to exchange from - [CURRENCY_TO] Currency code to exchange to - [VALUE] Currency amount to exchange + [Currency input] Currency code to exchange from + [Currency target] Currency code to exchange to + [Amount] Currency amount to exchange Options: - -k, --set-api-key Set api key - -r, --recreate-cache Recrate cache - -i, --interactive Interactive mode - -l, --list List currencies - -L, --list-rates List exchange rate for currency - -h, --help Print help - + -k, --set-api-key Set api key + -r, --recreate-cache Recrate cache + -i, --interactive Interactive mode + -l, --list List currencies + -L, --list-rates List exchange rate for currency + -h, --help Print help ``` # Build Needs rust and cargo, build tested on rust v1.76.0\ diff --git a/src/main.rs b/src/main.rs index 4be477b..307f2c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,10 +17,13 @@ mod requests; struct Cli { /// Currency code to exchange from + #[arg(value_names = ["Currency input"])] currency_from: Option, /// Currency code to exchange to + #[arg(value_names = ["Currency target"])] currency_to: Option, /// Currency amount to exchange + #[arg(value_names = ["Amount"])] value: Option, /// Set api key @@ -38,7 +41,7 @@ struct Cli list: bool, /// List exchange rate for currency - #[arg(short = 'L', long = "list-rates")] + #[arg(short = 'L', long = "list-rates", value_names = ["currency"])] list_rates: Option, } async fn setup_key(key: String) -> Result>