diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-23 20:21:14 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-23 20:21:14 +0100 |
| commit | 92c6898e10bde9889aa61e1a4f7253245b8f592e (patch) | |
| tree | 5b74260acab9253d2b3854793bfb97bba4b5a8b8 /coreutils | |
| parent | 4cde4cca65c80106bdd97a7e532f3b80cf25fae5 (diff) | |
| download | busybox-w32-92c6898e10bde9889aa61e1a4f7253245b8f592e.tar.gz busybox-w32-92c6898e10bde9889aa61e1a4f7253245b8f592e.tar.bz2 busybox-w32-92c6898e10bde9889aa61e1a4f7253245b8f592e.zip | |
ls: handle -x through option_mask32, remove default -C from --help
function old new delta
packed_usage 31024 31002 -22
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/ls.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index 3052fda32..ac142c36b 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
| @@ -111,7 +111,7 @@ | |||
| 111 | //usage: "\n -1 One column output" | 111 | //usage: "\n -1 One column output" |
| 112 | //usage: "\n -a Include entries which start with ." | 112 | //usage: "\n -a Include entries which start with ." |
| 113 | //usage: "\n -A Like -a, but exclude . and .." | 113 | //usage: "\n -A Like -a, but exclude . and .." |
| 114 | //usage: "\n -C List by columns" | 114 | ////usage: "\n -C List by columns" - don't show, this is a default anyway |
| 115 | //usage: "\n -x List by lines" | 115 | //usage: "\n -x List by lines" |
| 116 | //usage: "\n -d List directory entries instead of contents" | 116 | //usage: "\n -d List directory entries instead of contents" |
| 117 | //usage: IF_FEATURE_LS_FOLLOWLINKS( | 117 | //usage: IF_FEATURE_LS_FOLLOWLINKS( |
| @@ -198,12 +198,11 @@ LIST_LONG = 1 << 0, /* long listing (-l and equivalents) */ | |||
| 198 | 198 | ||
| 199 | /* what files will be displayed */ | 199 | /* what files will be displayed */ |
| 200 | DISP_DIRNAME = 1 << 1, /* 2 or more items? label directories */ | 200 | DISP_DIRNAME = 1 << 1, /* 2 or more items? label directories */ |
| 201 | DISP_ROWS = 1 << 2, /* print across rows */ | ||
| 202 | 201 | ||
| 203 | /* what is the overall style of the listing */ | 202 | /* what is the overall style of the listing */ |
| 204 | STYLE_COLUMNAR = 1 << 3, /* many records per line */ | 203 | STYLE_COLUMNAR = 1 << 2, /* many records per line */ |
| 205 | STYLE_LONG = 2 << 3, /* one record per line, extended info */ | 204 | STYLE_LONG = 2 << 2, /* one record per line, extended info */ |
| 206 | STYLE_SINGLE = 3 << 3, /* one record per line */ | 205 | STYLE_SINGLE = 3 << 2, /* one record per line */ |
| 207 | STYLE_MASK = STYLE_SINGLE, | 206 | STYLE_MASK = STYLE_SINGLE, |
| 208 | }; | 207 | }; |
| 209 | 208 | ||
| @@ -241,7 +240,7 @@ enum { | |||
| 241 | OPT_g = (1 << 6), | 240 | OPT_g = (1 << 6), |
| 242 | OPT_n = (1 << 7), | 241 | OPT_n = (1 << 7), |
| 243 | OPT_s = (1 << 8), | 242 | OPT_s = (1 << 8), |
| 244 | //OPT_x = (1 << 9), | 243 | OPT_x = (1 << 9), |
| 245 | OPT_A = (1 << 10), | 244 | OPT_A = (1 << 10), |
| 246 | //OPT_k = (1 << 11), | 245 | //OPT_k = (1 << 11), |
| 247 | 246 | ||
| @@ -300,7 +299,7 @@ static const uint8_t opt_flags[] = { | |||
| 300 | LIST_LONG | STYLE_LONG, /* g (don't show owner) - handled via OPT_g. assumes l */ | 299 | LIST_LONG | STYLE_LONG, /* g (don't show owner) - handled via OPT_g. assumes l */ |
| 301 | LIST_LONG | STYLE_LONG, /* n (numeris uid/gid) - handled via OPT_n. assumes l */ | 300 | LIST_LONG | STYLE_LONG, /* n (numeris uid/gid) - handled via OPT_n. assumes l */ |
| 302 | 0, /* s */ | 301 | 0, /* s */ |
| 303 | DISP_ROWS | STYLE_COLUMNAR, /* x */ | 302 | STYLE_COLUMNAR, /* x */ |
| 304 | 0xff | 303 | 0xff |
| 305 | /* options after -x are not processed through opt_flags */ | 304 | /* options after -x are not processed through opt_flags */ |
| 306 | }; | 305 | }; |
| @@ -698,7 +697,7 @@ static void display_files(struct dnode **dn, unsigned nfiles) | |||
| 698 | for (row = 0; row < nrows; row++) { | 697 | for (row = 0; row < nrows; row++) { |
| 699 | for (nc = 0; nc < ncols; nc++) { | 698 | for (nc = 0; nc < ncols; nc++) { |
| 700 | /* reach into the array based on the column and row */ | 699 | /* reach into the array based on the column and row */ |
| 701 | if (G.all_fmt & DISP_ROWS) | 700 | if (option_mask32 & OPT_x) |
| 702 | i = (row * ncols) + nc; /* display across row */ | 701 | i = (row * ncols) + nc; /* display across row */ |
| 703 | else | 702 | else |
| 704 | i = (nc * nrows) + row; /* display by column */ | 703 | i = (nc * nrows) + row; /* display by column */ |
