cli: Add --confirmed option to a couple commands, also add --no-header (#7112)

* Add --confirmed option to get-slot, get-epoch-info, get-transaction-count

* Add --no-header option
This commit is contained in:
Michael Vines
2019-11-24 17:34:18 -07:00
committed by GitHub
parent 702f7cc51d
commit d5beb8a9e4
4 changed files with 151 additions and 42 deletions

View File

@@ -133,12 +133,15 @@ pub fn parse_args(matches: &ArgMatches<'_>) -> Result<CliConfig, Box<dyn error::
(default.keypair, None)
};
let print_header = !matches.is_present("no_header");
Ok(CliConfig {
command,
json_rpc_url,
keypair,
keypair_path,
rpc_client: None,
print_header,
})
}
@@ -182,6 +185,12 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.takes_value(true)
.help("/path/to/id.json"),
)
.arg(
Arg::with_name("no_header")
.long("no-header")
.global(true)
.help("Disable information header"),
)
.arg(
Arg::with_name(ASK_SEED_PHRASE_ARG.name)
.long(ASK_SEED_PHRASE_ARG.long)