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
8 changes: 8 additions & 0 deletions src/uu/pr/src/pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ mod options {
pub const COLUMN_WIDTH: &str = "width";
pub const PAGE_WIDTH: &str = "page-width";
pub const ACROSS: &str = "across";
pub const COLUMN_DOWN: &str = "column-down";
pub const COLUMN: &str = "column";
pub const COLUMN_CHAR_SEPARATOR: &str = "separator";
pub const COLUMN_STRING_SEPARATOR: &str = "sep-string";
Expand Down Expand Up @@ -257,6 +258,13 @@ pub fn uu_app() -> Command {
.help(translate!("pr-help-across"))
.action(ArgAction::SetTrue),
)
.arg(
// -b is a no-op for backwards compatibility (column-down is now the default)
Arg::new(options::COLUMN_DOWN)
.short('b')
.hide(true)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::COLUMN)
.long(options::COLUMN)
Expand Down
6 changes: 6 additions & 0 deletions tests/by-util/test_pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,3 +616,9 @@ fn test_version() {
fn test_pr_char_device_dev_null() {
new_ucmd!().arg("/dev/null").succeeds();
}

#[test]
fn test_b_flag_backwards_compat() {
// -b is a no-op for backwards compatibility (column-down is now the default)
new_ucmd!().args(&["-b", "-t"]).pipe_in("a\nb\n").succeeds();
}
Loading