mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
fix(more) Return a proper error message when no argument is provided
Fix #1509
This commit is contained in:
parent
279de2d664
commit
80203a7a02
1 changed files with 6 additions and 0 deletions
|
@ -41,6 +41,12 @@ static VERSION: &str = env!("CARGO_PKG_VERSION");
|
|||
pub fn uumain(args: Vec<String>) -> i32 {
|
||||
let mut opts = Options::new();
|
||||
|
||||
// FixME: fail without panic for now; but `more` should work with no arguments (ie, for piped input)
|
||||
if args.len() < 2 {
|
||||
println!("{}: incorrect usage", args[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
opts.optflag("h", "help", "display this help and exit");
|
||||
opts.optflag("v", "version", "output version information and exit");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue