File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -778,17 +778,19 @@ fn build_options(
778778 // --column has more priority than -column
779779
780780 let column_option_value = match parse_usize ( matches, options:: COLUMN ) {
781- Some ( res) => Some ( res?) ,
781+ Some ( Ok ( 0 ) ) => {
782+ // if --column is zero, exit with code 1.
783+ return Err ( PrError :: EncounteredErrors {
784+ msg : "invalid -column argument '0'" . to_string ( ) ,
785+ } ) ;
786+ }
787+ Some ( res) => {
788+ println ! ( "{:?}" , res) ;
789+ Some ( res?)
790+ }
782791 None => start_column_option,
783792 } ;
784793
785- // exit with code 1 if column argument is 0.
786- if column_option_value == Some ( 0 ) {
787- return Err ( PrError :: EncounteredErrors {
788- msg : "invalid -column argument '0'" . to_string ( ) ,
789- } ) ;
790- }
791-
792794 let column_mode_options = column_option_value. map ( |columns| ColumnModeOptions {
793795 columns,
794796 width : column_width,
You can’t perform that action at this time.
0 commit comments