Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/uu/pmap/src/pmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ mod options {

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
// procps-ng accepts -XX as a distinct short option. clap cannot represent a
// two-character short flag next to -X, so map the GNU spelling to --XX.
let args = args.map(|arg| if arg == "-XX" { "--XX".into() } else { arg });
let matches = uu_app().try_get_matches_from(args)?;

if matches.get_flag(options::CREATE_RC) {
Expand Down
15 changes: 8 additions & 7 deletions tests/by-util/test_pmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,15 @@ fn test_more_extended() {
fn test_most_extended() {
let pid = process::id();

let arg = "--XX";
let result = new_ucmd!()
.arg(arg)
.arg(pid.to_string())
.succeeds()
.stdout_move_str();
for arg in ["--XX", "-XX"] {
let result = new_ucmd!()
.arg(arg)
.arg(pid.to_string())
.succeeds()
.stdout_move_str();

assert_most_extended_format(pid, &result, false, false);
assert_most_extended_format(pid, &result, false, false);
}
}

#[test]
Expand Down
Loading