mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
pr: add -b flag for backwards compatibility
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user