File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ mod options {
4848 pub const COLUMN_WIDTH : & str = "width" ;
4949 pub const PAGE_WIDTH : & str = "page-width" ;
5050 pub const ACROSS : & str = "across" ;
51+ pub const COLUMN_DOWN : & str = "column-down" ;
5152 pub const COLUMN : & str = "column" ;
5253 pub const COLUMN_CHAR_SEPARATOR : & str = "separator" ;
5354 pub const COLUMN_STRING_SEPARATOR : & str = "sep-string" ;
@@ -257,6 +258,13 @@ pub fn uu_app() -> Command {
257258 . help ( translate ! ( "pr-help-across" ) )
258259 . action ( ArgAction :: SetTrue ) ,
259260 )
261+ . arg (
262+ // -b is a no-op for backwards compatibility (column-down is now the default)
263+ Arg :: new ( options:: COLUMN_DOWN )
264+ . short ( 'b' )
265+ . hide ( true )
266+ . action ( ArgAction :: SetTrue ) ,
267+ )
260268 . arg (
261269 Arg :: new ( options:: COLUMN )
262270 . long ( options:: COLUMN )
Original file line number Diff line number Diff line change @@ -616,3 +616,9 @@ fn test_version() {
616616fn test_pr_char_device_dev_null ( ) {
617617 new_ucmd ! ( ) . arg ( "/dev/null" ) . succeeds ( ) ;
618618}
619+
620+ #[ test]
621+ fn test_b_flag_backwards_compat ( ) {
622+ // -b is a no-op for backwards compatibility (column-down is now the default)
623+ new_ucmd ! ( ) . args ( & [ "-b" , "-t" ] ) . pipe_in ( "a\n b\n " ) . succeeds ( ) ;
624+ }
You can’t perform that action at this time.
0 commit comments