Use args::file()
for input spec - base32/base64/rev
This commit is contained in:
parent
aa89efe63a
commit
859071698a
@ -33,7 +33,7 @@ impl Cmd for Base32 {
|
||||
}
|
||||
_ => ColorChoice::Never,
|
||||
};
|
||||
if let Some(files) = matches.get_many::<String>("files") {
|
||||
if let Some(files) = matches.get_many::<String>("file") {
|
||||
let (len, _) = files.size_hint();
|
||||
for (index, file) in files.into_iter().enumerate() {
|
||||
if { len > 1 || matches.get_flag("verbose") } && !matches.get_flag("QUIET") {
|
||||
@ -75,10 +75,7 @@ impl Cmd for Base32 {
|
||||
|
||||
pub fn args() -> [Arg; 7] {
|
||||
[
|
||||
Arg::new("INPUT")
|
||||
.help("The input file to use")
|
||||
.num_args(1..)
|
||||
.default_value("-"),
|
||||
args::file(),
|
||||
Arg::new("DECODE")
|
||||
.help("Decode rather than encode")
|
||||
.short('d')
|
||||
|
@ -32,7 +32,7 @@ impl Cmd for Base64 {
|
||||
}
|
||||
_ => ColorChoice::Never,
|
||||
};
|
||||
if let Some(files) = matches.get_many::<String>("INPUT") {
|
||||
if let Some(files) = matches.get_many::<String>("file") {
|
||||
let (len, _) = files.size_hint();
|
||||
for (index, file) in files.enumerate() {
|
||||
if { len > 1 || matches.get_flag("VERBOSE") } && !matches.get_flag("QUIET") {
|
||||
|
@ -18,10 +18,7 @@ impl Cmd for Rev {
|
||||
.args([
|
||||
args::header(),
|
||||
args::color(),
|
||||
Arg::new("file")
|
||||
.help("if file is '-' read from stdin")
|
||||
.num_args(1..)
|
||||
.default_value("-"),
|
||||
args::file(),
|
||||
])
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user