Changeset View
Changeset View
Standalone View
Standalone View
bin/ls/ls.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | /* flags */ | ||||
int f_humanval; /* show human-readable file sizes */ | int f_humanval; /* show human-readable file sizes */ | ||||
int f_inode; /* print inode */ | int f_inode; /* print inode */ | ||||
static int f_kblocks; /* print size in kilobytes */ | static int f_kblocks; /* print size in kilobytes */ | ||||
int f_label; /* show MAC label */ | int f_label; /* show MAC label */ | ||||
static int f_listdir; /* list actual directory, not contents */ | static int f_listdir; /* list actual directory, not contents */ | ||||
static int f_listdot; /* list files beginning with . */ | static int f_listdot; /* list files beginning with . */ | ||||
int f_longform; /* long listing format */ | int f_longform; /* long listing format */ | ||||
static int f_noautodot; /* do not automatically enable -A for root */ | static int f_noautodot; /* do not automatically enable -A for root */ | ||||
static int f_nofollow; /* don't follow symbolic link arguments */ | int f_nofollow; /* don't follow symbolic link arguments */ | ||||
int f_printea; /* print any extended attributes on a file */ | |||||
int f_nonprint; /* show unprintables as ? */ | int f_nonprint; /* show unprintables as ? */ | ||||
static int f_nosort; /* don't sort output */ | static int f_nosort; /* don't sort output */ | ||||
int f_notabs; /* don't use tab-separated multi-col output */ | int f_notabs; /* don't use tab-separated multi-col output */ | ||||
static int f_numericonly; /* don't convert uid/gid to name */ | static int f_numericonly; /* don't convert uid/gid to name */ | ||||
int f_octal; /* show unprintables as \xxx */ | int f_octal; /* show unprintables as \xxx */ | ||||
int f_octal_escape; /* like f_octal but use C escapes if possible */ | int f_octal_escape; /* like f_octal but use C escapes if possible */ | ||||
static int f_recursive; /* ls subdirectories also */ | static int f_recursive; /* ls subdirectories also */ | ||||
static int f_reversesort; /* reverse whatever sort is used */ | static int f_reversesort; /* reverse whatever sort is used */ | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | #endif | ||||
if (errstr) | if (errstr) | ||||
termwidth = 80; | termwidth = 80; | ||||
fts_options = FTS_PHYSICAL; | fts_options = FTS_PHYSICAL; | ||||
if (getenv("LS_SAMESORT")) | if (getenv("LS_SAMESORT")) | ||||
f_samesort = 1; | f_samesort = 1; | ||||
while ((ch = getopt_long(argc, argv, | while ((ch = getopt_long(argc, argv, | ||||
"+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, | "+1@ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, | ||||
NULL)) != -1) { | NULL)) != -1) { | ||||
switch (ch) { | switch (ch) { | ||||
/* | /* | ||||
* The -1, -C, -x and -l options all override each other so | * The -1, -C, -x and -l options all override each other so | ||||
* shell aliasing works right. | * shell aliasing works right. | ||||
*/ | */ | ||||
case '1': | case '1': | ||||
f_singlecol = 1; | f_singlecol = 1; | ||||
f_longform = 0; | f_longform = 0; | ||||
f_stream = 0; | f_stream = 0; | ||||
break; | break; | ||||
case 'C': | case 'C': | ||||
f_sortacross = f_longform = f_singlecol = 0; | f_sortacross = f_longform = f_singlecol = 0; | ||||
break; | |||||
case '@': | |||||
f_printea = 1; | |||||
break; | break; | ||||
case 'l': | case 'l': | ||||
f_longform = 1; | f_longform = 1; | ||||
f_singlecol = 0; | f_singlecol = 0; | ||||
f_stream = 0; | f_stream = 0; | ||||
break; | break; | ||||
case 'x': | case 'x': | ||||
f_sortacross = 1; | f_sortacross = 1; | ||||
▲ Show 20 Lines • Show All 738 Lines • Show Last 20 Lines |