pr: add -b flag for backwards compatibility

This commit is contained in:
Christopher Dryden
2026-01-02 20:22:28 +00:00
parent c96b96e233
commit 0e85a93c6c
2 changed files with 14 additions and 0 deletions
+8
View File
@@ -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";
@@ -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)
+6
View File
@@ -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();
}