feat(args): add ineffective arguments for BSD compatibility

This commit is contained in:
Orhun Parmaksız 2021-12-15 17:27:29 +03:00
parent e49155a503
commit 56a8f40203
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -73,6 +73,8 @@ impl Args {
);
opts.optflag("q", "quiet", "do not print variable after the value is set");
opts.optflag("w", "write", "only enable writing a value to variable");
opts.optflag("o", "", "does nothing");
opts.optflag("x", "", "does nothing");
opts.optflag("d", "", "alias of -h");
opts.optflag(
"E",
@ -114,7 +116,9 @@ impl Args {
.replace(
"{usage}",
&opts
.filter(|msg| !msg.contains("alias of"))
.filter(|msg| {
!(msg.contains("alias of") || msg.contains("does nothing"))
})
.collect::<Vec<String>>()
.join("\n"),
)