Update help text variable names
This commit is contained in:
parent
4974abef37
commit
c5e962ef43
21
README.md
21
README.md
|
@ -10,21 +10,20 @@ currency-exchange --interactive
|
||||||
```
|
```
|
||||||
More information on usage:
|
More information on usage:
|
||||||
```
|
```
|
||||||
Usage: currency-exchange [OPTIONS] [CURRENCY_FROM] [CURRENCY_TO] [VALUE]
|
Usage: currency-exchange [OPTIONS] [Currency input] [Currency target] [Amount]
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
[CURRENCY_FROM] Currency code to exchange from
|
[Currency input] Currency code to exchange from
|
||||||
[CURRENCY_TO] Currency code to exchange to
|
[Currency target] Currency code to exchange to
|
||||||
[VALUE] Currency amount to exchange
|
[Amount] Currency amount to exchange
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-k, --set-api-key <API_KEY> Set api key
|
-k, --set-api-key <API_KEY> Set api key
|
||||||
-r, --recreate-cache Recrate cache
|
-r, --recreate-cache Recrate cache
|
||||||
-i, --interactive Interactive mode
|
-i, --interactive Interactive mode
|
||||||
-l, --list List currencies
|
-l, --list List currencies
|
||||||
-L, --list-rates <LIST_RATES> List exchange rate for currency
|
-L, --list-rates <currency> List exchange rate for currency
|
||||||
-h, --help Print help
|
-h, --help Print help
|
||||||
|
|
||||||
```
|
```
|
||||||
# Build
|
# Build
|
||||||
Needs rust and cargo, build tested on rust v1.76.0\
|
Needs rust and cargo, build tested on rust v1.76.0\
|
||||||
|
|
|
@ -17,10 +17,13 @@ mod requests;
|
||||||
struct Cli
|
struct Cli
|
||||||
{
|
{
|
||||||
/// Currency code to exchange from
|
/// Currency code to exchange from
|
||||||
|
#[arg(value_names = ["Currency input"])]
|
||||||
currency_from: Option<String>,
|
currency_from: Option<String>,
|
||||||
/// Currency code to exchange to
|
/// Currency code to exchange to
|
||||||
|
#[arg(value_names = ["Currency target"])]
|
||||||
currency_to: Option<String>,
|
currency_to: Option<String>,
|
||||||
/// Currency amount to exchange
|
/// Currency amount to exchange
|
||||||
|
#[arg(value_names = ["Amount"])]
|
||||||
value: Option<String>,
|
value: Option<String>,
|
||||||
|
|
||||||
/// Set api key
|
/// Set api key
|
||||||
|
@ -38,7 +41,7 @@ struct Cli
|
||||||
list: bool,
|
list: bool,
|
||||||
|
|
||||||
/// List exchange rate for currency
|
/// List exchange rate for currency
|
||||||
#[arg(short = 'L', long = "list-rates")]
|
#[arg(short = 'L', long = "list-rates", value_names = ["currency"])]
|
||||||
list_rates: Option<String>,
|
list_rates: Option<String>,
|
||||||
}
|
}
|
||||||
async fn setup_key(key: String) -> Result<bool, Box<dyn std::error::Error>>
|
async fn setup_key(key: String) -> Result<bool, Box<dyn std::error::Error>>
|
||||||
|
|
Reference in New Issue