ls.c (157101) | ls.c (177907) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Michael Fischbein. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 28 unchanged lines hidden (view full) --- 37#endif /* not lint */ 38 39#if 0 40#ifndef lint 41static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94"; 42#endif /* not lint */ 43#endif 44#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Michael Fischbein. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 28 unchanged lines hidden (view full) --- 37#endif /* not lint */ 38 39#if 0 40#ifndef lint 41static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94"; 42#endif /* not lint */ 43#endif 44#include <sys/cdefs.h> |
45__FBSDID("$FreeBSD: head/bin/ls/ls.c 157101 2006-03-24 17:09:03Z jhb $"); | 45__FBSDID("$FreeBSD: head/bin/ls/ls.c 177907 2008-04-04 03:57:46Z grog $"); |
46 47#include <sys/types.h> 48#include <sys/stat.h> 49#include <sys/ioctl.h> 50#include <sys/mac.h> 51 52#include <dirent.h> 53#include <err.h> --- 66 unchanged lines hidden (view full) --- 120 int f_octal; /* show unprintables as \xxx */ 121 int f_octal_escape; /* like f_octal but use C escapes if possible */ 122static int f_recursive; /* ls subdirectories also */ 123static int f_reversesort; /* reverse whatever sort is used */ 124 int f_sectime; /* print the real time for all files */ 125static int f_singlecol; /* use single column output */ 126 int f_size; /* list size in short listing */ 127 int f_slash; /* similar to f_type, but only for dirs */ | 46 47#include <sys/types.h> 48#include <sys/stat.h> 49#include <sys/ioctl.h> 50#include <sys/mac.h> 51 52#include <dirent.h> 53#include <err.h> --- 66 unchanged lines hidden (view full) --- 120 int f_octal; /* show unprintables as \xxx */ 121 int f_octal_escape; /* like f_octal but use C escapes if possible */ 122static int f_recursive; /* ls subdirectories also */ 123static int f_reversesort; /* reverse whatever sort is used */ 124 int f_sectime; /* print the real time for all files */ 125static int f_singlecol; /* use single column output */ 126 int f_size; /* list size in short listing */ 127 int f_slash; /* similar to f_type, but only for dirs */ |
128 int f_sortacross; /* sort across rows, not down columns */ | 128 int f_sortacross; /* sort across rows, not down columns */ |
129 int f_statustime; /* use time of last mode change */ 130static int f_stream; /* stream the output, separate with commas */ 131static int f_timesort; /* sort by time vice name */ | 129 int f_statustime; /* use time of last mode change */ 130static int f_stream; /* stream the output, separate with commas */ 131static int f_timesort; /* sort by time vice name */ |
132 char *f_timeformat; /* user-specified time format */ |
|
132static int f_sizesort; 133 int f_type; /* add type character for non-regular files */ 134static int f_whiteout; /* show whiteout entries */ 135 int f_label; /* show MAC label */ 136#ifdef COLORLS 137 int f_color; /* add type in color for non-regular files */ 138 139char *ansi_bgcol; /* ANSI sequence to set background colour */ --- 34 unchanged lines hidden (view full) --- 174 /* retrieve environment variable, in case of explicit -C */ 175 p = getenv("COLUMNS"); 176 if (p) 177 termwidth = atoi(p); 178 } 179 180 fts_options = FTS_PHYSICAL; 181 while ((ch = getopt(argc, argv, | 133static int f_sizesort; 134 int f_type; /* add type character for non-regular files */ 135static int f_whiteout; /* show whiteout entries */ 136 int f_label; /* show MAC label */ 137#ifdef COLORLS 138 int f_color; /* add type in color for non-regular files */ 139 140char *ansi_bgcol; /* ANSI sequence to set background colour */ --- 34 unchanged lines hidden (view full) --- 175 /* retrieve environment variable, in case of explicit -C */ 176 p = getenv("COLUMNS"); 177 if (p) 178 termwidth = atoi(p); 179 } 180 181 fts_options = FTS_PHYSICAL; 182 while ((ch = getopt(argc, argv, |
182 "1ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx")) != -1) { | 183 "1ABCD:FGHILPRSTUWZabcdfghiklmnopqrstuwx")) != -1) { |
183 switch (ch) { 184 /* 185 * The -1, -C, -x and -l options all override each other so 186 * shell aliasing works right. 187 */ 188 case '1': 189 f_singlecol = 1; 190 f_longform = 0; 191 f_stream = 0; 192 break; 193 case 'B': 194 f_nonprint = 0; 195 f_octal = 1; 196 f_octal_escape = 0; 197 break; 198 case 'C': 199 f_sortacross = f_longform = f_singlecol = 0; 200 break; | 184 switch (ch) { 185 /* 186 * The -1, -C, -x and -l options all override each other so 187 * shell aliasing works right. 188 */ 189 case '1': 190 f_singlecol = 1; 191 f_longform = 0; 192 f_stream = 0; 193 break; 194 case 'B': 195 f_nonprint = 0; 196 f_octal = 1; 197 f_octal_escape = 0; 198 break; 199 case 'C': 200 f_sortacross = f_longform = f_singlecol = 0; 201 break; |
202 case 'D': 203 f_timeformat = optarg; 204 break; |
|
201 case 'l': 202 f_longform = 1; 203 f_singlecol = 0; 204 f_stream = 0; 205 break; 206 case 'x': 207 f_sortacross = 1; 208 f_longform = 0; --- 668 unchanged lines hidden --- | 205 case 'l': 206 f_longform = 1; 207 f_singlecol = 0; 208 f_stream = 0; 209 break; 210 case 'x': 211 f_sortacross = 1; 212 f_longform = 0; --- 668 unchanged lines hidden --- |