Commit Graph

148 Commits

Author SHA1 Message Date
he 0a97c3f688 Complete the move of string_to_flags() and flags_to_string() from the
bin/ls sources to libutil:
 o Bump libutil minor version number
 o Fix uses to include <util.h> to pick up the function definitions
 o Fix most uses of flags_to_string() to release the now-malloc()ed result
2006-12-14 20:09:35 +00:00
he 29ff6ed16a The "#ifdef UNUSED_BLOCK" in stat_flags.c wasn't so unused after
all -- it was used by the mtree source.  So, instead do an "#ifdef
MTREE", and define that one when building mtree.
2006-12-14 17:54:19 +00:00
christos 78509e7f31 Pass lint. From Anon Ymous 2006-12-14 14:15:26 +00:00
elad 8fea60435c PR/34499: mac at S dot culver dot net: ls allocates more memory than needed
Applied patch, thanks!
2006-09-23 19:54:53 +00:00
elad cfbe6aa48d PR/33635: Anne Bennett: Document 'a' and 'A' flags in ls(1).
strmode(3) already documented these, so use the description from there.
2006-09-22 23:00:32 +00:00
christos eae5877e02 from zafer: you can have either -k or -h but not both since it does not make
sense.
2006-08-21 19:08:47 +00:00
wiz 3598f93379 Fix date (no leading zero), fix xref: sticky(7) not (8). 2006-04-08 22:39:39 +00:00
jschauma b338995776 Address PR 30374 as suggested in there:
"Modify the man page to match the behaviour of "ls -q",

(done by yamt@ previously)

...
modify both the behaviour and documentation for "ls -b" and "ls -B" to
make spaces readily apparent.  This could be done by adding VIS_WHITE
to the flags passed to strvis(3) in the safe_print() function in
src/bin/ls/util.c."

'ls -b' now yields foo\sbar (whitespace) foo\tbar (tab) foo\rbar (CR).
'ls -B' now yields foo\040bar foo\011bar foo\015bar.
2006-04-08 22:28:06 +00:00
yamt 3dc055fb76 s/non-graphic/non-printable/ to match with the code. 2006-04-08 12:04:22 +00:00
christos 7e2f55514f Coverity CID 1755: Add fts_close() in traverse. 2006-03-22 16:20:34 +00:00
jschauma 0386433d98 Somehow missed this in the last commit, where I only changed the commentary
to reflect the actual change (plus minor nits).  So here's the actual change:

Rather than '-h' suppressing '-s' when using '-l', make it display
the blocks used in human readable form, as suggested by Alan Barrett
and Daniel Carosone.

(Missing bits spotted, as usual, by wiz@.)
2005-10-31 14:13:33 +00:00
jschauma ea274fd69c Rather than '-h' suppressing '-s' when using '-l', make it display
the blocks used in human readable form, as suggested by Alan Barrett
and Daniel Carosone.
2005-10-26 02:24:22 +00:00
jschauma 3478ebe108 document that -h makes -l suppress -s.
(Ie 'ls -lhs' == 'ls -lh')
2005-10-23 20:52:47 +00:00
jschauma ff54312f75 Honor the COLUMNS variable even when producing output not to a terminal,
as long as a specific format (that could use COLUMNS) was requested.
This makes

env COLUMNS=50 ls -C > file

not surprise the user who clearly wanted some specific output in the file.
2005-10-14 16:02:26 +00:00
wiz 803ccc7cb0 Bump date for previous. 2005-10-10 20:46:17 +00:00
jschauma 98615dcf47 Document that '-g' overrides -1, -C, -m, and -x, but is _always_
overridden by '-l', even if '-g' was specified last.
2005-10-10 20:30:34 +00:00
elad 2d28a8933f Document -L correctly. PR #30430. 2005-08-13 15:59:28 +00:00
hira f999ca1abd Sort options (description). 2005-06-17 14:40:47 +00:00
hira a2ed3bbe80 - Add -h to usage.
- Use set/getprogname(3).
2005-06-17 14:36:16 +00:00
pooka 2cf84fc283 Clarify the description for -s to include a pointer to an explanation
on how BLOCKSIZE affects the parameter.
2005-05-11 09:10:49 +00:00
jschauma 5398861167 The '-l' option *always* prints a total, not only if output is to a
terminal.
2005-01-09 16:33:32 +00:00
mycroft 75a40767d0 Print some future timestamps with HH:MM rather than YYYY, so that we get
something reasonable if we're using a file server whose time is slightly
ahead.
2004-11-17 17:00:00 +00:00
jschauma 1a12f82f4b If a files date is any time in the future (not six months or more),
use "date "+%b %e %Y"" format.  This is what SUSv3 says.
Ok jdolecek, dsl
2004-08-09 20:14:54 +00:00
jschauma 6734ab72b9 Clarify meaning of '-c' flag by using similar wording as for '-u' flag. 2004-08-06 03:17:19 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
wiz 07d5d4dfe3 Crossreference -h and -k. Use Aq instead of \*[Lt]\*[Gt]. 2003-12-26 11:19:50 +00:00
simonb ba2dda9f8e Fix bug with previous change- always initialise d.s_block. Now "ls -1sh"
works.
XXX: ls -sh now always uses 4 chars for the size column width even if it
     needs less than that.
2003-12-26 10:51:25 +00:00
simonb c4d01568e0 KNF - wrap long lines. 2003-12-26 10:47:32 +00:00
grant f4c4780250 implement -h(umanize).
from David P. Reese Jr. in PR bin/23870.
2003-12-26 06:19:19 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
wiz 835710a2a0 Bump date for previous; comma cleanup. 2003-09-22 06:01:43 +00:00
jschauma 21ab633500 After last weeks addition of the '-b' flag, add '-B' and '-w' flags,
suggested by uwe@, inspired by FreeBSD.  The three flags override
each other (and the '-q' flag) and behave as follows:

     -B      Force printing of non-printable characters in file names as
	     \xxx, where xxx is the numeric value of the character in octal.

     -b      As -B, but use C escape codes whenever possible.

     -w      Force raw printing of non-printable characters.  This is the
             default when output is not to a terminal.
2003-09-22 02:43:19 +00:00
wiz fb2e1913c5 Bump date for previous. 2003-09-14 21:56:25 +00:00
jschauma 2ccef82cc4 Implement '-b' option, which, following FreeBSD, Linux and (I think) Solaris
prints octal escapes for nongraphic characters.
2003-09-14 19:16:05 +00:00
wiz 4157dbb127 Sort options (AaBb...). 2003-09-02 08:36:20 +00:00
wiz 9fdd63d776 From FreeBSD bug report 54294, via Jonathan Gray and then jmc@openbsd:
-l option to ls(1) gives all permissions, not just owner and group.
2003-08-28 19:44:09 +00:00
itojun e1e0321817 use bounded string op 2003-08-13 02:51:20 +00:00
agc b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
simonb ae46649fa5 Pass a NULL to getbsize() for any arguments that aren't needed, and
remove the otherwise unused variables.
2003-05-30 00:17:25 +00:00
kleink 7c8d837e74 If both -g and -l options are present, let -l take precedence over -g,
as requested by several users.

POSIX-2001 is unclear on conflicting option letters as far as the -g
option is concerned; a clarification request will be made.

Addresses PR bin/21519 by Geoff Wing.
2003-05-11 08:06:01 +00:00
simonb 7efb28b165 Add a FALLTHROUGH to keep lint happy. 2003-05-07 13:23:32 +00:00
grant 75d0e9d0c0 make -g behave as it should according to SUSv3 (long listing without
owner).

ok'd by kleink@.
2003-05-07 13:00:24 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
grant fbaeb4bd05 some mdoc improvements.
ok'd by wiz.
2003-02-10 16:10:22 +00:00
itojun 6bf8c47b32 we can't do {} while (0) for TEST() macro since it has "break" which
goes out of the switch statement.  from shin-ichi kaneta.
2002-11-16 13:42:36 +00:00
enami 0cb758feb5 Default .Ar arugment is sufficient. 2002-11-09 12:27:53 +00:00
enami 54a944c353 Cosmetic changes. 2002-11-09 12:27:08 +00:00
simonb 4bce9043f0 Need to initialise the blocksize variable if the -i option is used
too.  The code in display() could possibly be a bit smarter about this
requirement...

Fixes the problem in PR bin/18321 from David Laight and PR bin/18436
from FUKAUMI Naoki.
2002-09-27 12:01:51 +00:00
wiz 14dfaa4b03 New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.
2002-09-25 15:18:36 +00:00
sommerfeld af723a4db0 Use the output blocksize when computing how much room to leave for the
-s option, to suppress unnecessary leading spaces.
2002-09-14 04:25:55 +00:00