mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
comm: add --version
This commit is contained in:
parent
d34d85ae37
commit
c841b518d1
1 changed files with 6 additions and 0 deletions
|
@ -88,6 +88,7 @@ pub fn main() {
|
|||
getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"),
|
||||
getopts::optflag("3", "", "suppress column 3 (lines that appear in both files)"),
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
getopts::optflag("V", "version", "output version information and exit"),
|
||||
];
|
||||
|
||||
let matches = match getopts::getopts(args.tail(), opts) {
|
||||
|
@ -95,6 +96,11 @@ pub fn main() {
|
|||
Err(err) => fail!("{}", err.to_err_msg()),
|
||||
};
|
||||
|
||||
if matches.opt_present("version") {
|
||||
println!("{} {}", NAME, VERSION);
|
||||
return;
|
||||
}
|
||||
|
||||
if matches.opt_present("help") || matches.free.len() != 2 {
|
||||
println!("{} {}", NAME, VERSION);
|
||||
println!("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue