mirror of
https://github.com/lov3b/ecb-rates.git
synced 2025-02-22 18:00:11 +01:00
Better time name
This commit is contained in:
parent
34f40b3602
commit
f116b06c0c
@ -13,9 +13,9 @@ pub struct Cli {
|
|||||||
#[arg(value_enum, default_value_t = FormatOption::Plain)]
|
#[arg(value_enum, default_value_t = FormatOption::Plain)]
|
||||||
pub command: FormatOption,
|
pub command: FormatOption,
|
||||||
|
|
||||||
/// Show the time in the output
|
/// Don't show time in output
|
||||||
#[arg(long = "display-time", default_value_t = true)]
|
#[arg(long = "no-time")]
|
||||||
pub display_time: bool,
|
pub no_time: bool,
|
||||||
|
|
||||||
/// Print currencies in a compact single line
|
/// Print currencies in a compact single line
|
||||||
#[arg(long = "compact")]
|
#[arg(long = "compact")]
|
||||||
|
@ -94,7 +94,7 @@ async fn main() -> ExitCode {
|
|||||||
.map(|x| serde_json::to_value(x).expect("Failed to parse content as JSON value"))
|
.map(|x| serde_json::to_value(x).expect("Failed to parse content as JSON value"))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
if !cli.display_time {
|
if cli.no_time {
|
||||||
json_values
|
json_values
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.filter_map(|json_value| json_value.as_object_mut())
|
.filter_map(|json_value| json_value.as_object_mut())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user