mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
stty: fix negated options getting rejected by clap
This commit is contained in:
parent
97ef9e7be2
commit
4be9e7679d
2 changed files with 15 additions and 1 deletions
|
@ -646,6 +646,7 @@ pub fn uu_app() -> Command {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::SETTINGS)
|
Arg::new(options::SETTINGS)
|
||||||
.action(ArgAction::Append)
|
.action(ArgAction::Append)
|
||||||
|
.allow_hyphen_values(true)
|
||||||
.help("settings to change"),
|
.help("settings to change"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// For the full copyright and license information, please view the LICENSE
|
// For the full copyright and license information, please view the LICENSE
|
||||||
// file that was distributed with this source code.
|
// file that was distributed with this source code.
|
||||||
// spell-checker:ignore parenb parmrk ixany iuclc onlcr ofdel icanon noflsh
|
// spell-checker:ignore parenb parmrk ixany iuclc onlcr ofdel icanon noflsh econl igpar
|
||||||
|
|
||||||
use uutests::new_ucmd;
|
use uutests::new_ucmd;
|
||||||
use uutests::util::TestScenario;
|
use uutests::util::TestScenario;
|
||||||
|
@ -97,3 +97,16 @@ fn invalid_mapping() {
|
||||||
.fails()
|
.fails()
|
||||||
.stderr_contains("invalid integer argument: '0400': Value too large for defined data type");
|
.stderr_contains("invalid integer argument: '0400': Value too large for defined data type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn invalid_setting() {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["-econl"])
|
||||||
|
.fails()
|
||||||
|
.stderr_contains("invalid argument '-econl'");
|
||||||
|
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["igpar"])
|
||||||
|
.fails()
|
||||||
|
.stderr_contains("invalid argument 'igpar'");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue