Commit Graph

321 Commits

Author SHA1 Message Date
John Baldwin
bea12be630 Add a few more references to -U. 2006-03-24 16:43:58 +00:00
John Baldwin
fe79420eb7 Add a new -U flag to instruct ls to use the birthtime for printing or
sorting.

Submitted by:	Andrzej Tobola ato at iem dot pw dot edu dot pl
MFC after:	1 week
2006-03-24 16:38:02 +00:00
Ruslan Ermilov
8af1113166 -mdoc sweep. 2005-11-17 12:15:23 +00:00
Ruslan Ermilov
390a478eb0 Having three options (-a, -A, -I) controlling the output of dotted
files is too much and hard to follow.  Instead, make the -I option
just mean "do not automatically set -A for root".  That is, if -A
is explicitly set, -I is ignored.  Also, document -I in usage().
(The ls.c diff is better viewed relative to rev. 1.80.)

No objection:	mux
Silence from:	mnag
MFC after:	3 days
2005-11-16 07:13:37 +00:00
Maxime Henrion
86e79d090b Mention the non-standardness of the -I option in ls(1).
Spotted by:	ru
MFC after:	3 days
2005-11-10 14:26:50 +00:00
Maxime Henrion
7b7d153b21 Add a -I option to disable the automatic -A flag for the super-user.
PR:		bin/86710
Submitted by:	Marcus Alves Grando
MFC after:	3 days
2005-11-10 00:02:32 +00:00
Ralf S. Engelschall
f93a0797e0 fix typos: decribed -> described, preceeded -> preceded 2005-09-06 20:14:39 +00:00
Gary W. Swearingen
34602d8e7e Improved descriptions of block size handling.
PR:             docs/84765
Submitted by:   garys
Approved by:    keramida
MFC after:      3 days
2005-08-31 17:58:38 +00:00
Dima Dorfman
24b0280f8c Remove the EXAMPLES section that describes how to sort by size using
sort(1). This functionality is provided by the -S option now, and it
is useful even though a similar effect is achievable with sort(1),
since the latter doesn't work in combination with -h. This option is
also present in NetBSD, OpenBSD, and GNU fileutils, so there's clearly
a demand for it.

Noticed by:	asmodai
2005-06-03 11:38:35 +00:00
Dima Dorfman
77a15272e7 Improve wording: A sort is "in" a particular order, not "by" a
particular order.
2005-06-03 11:22:06 +00:00
Dima Dorfman
71b8b74887 Add the -S option to sort files by size. NetBSD and OpenBSD already
have this option with identical semantics (sorting large files first).
-r can be used to reverse the sort if that is desired.

PR:		81625
Submitted by:	Kostas Blekos <mplekos@physics.upatras.gr>, keramida
2005-06-03 11:05:58 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
a89237ae95 Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
Ruslan Ermilov
6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Joerg Wunsch
1c7adc9b77 The total sum of blocks for the -l and -s option is printed always,
regardless whether the output is to a terminal or not.  As this is
consistent with the SUSPv2 specification (even though we do not
otherwise fully implement SUSPv2's ls(1) options), document this as it
is now, rather than trying to change the behaviour itself.

PR:		docs/76072
Submitted by:	Sebastian Rey <Sebastian.rey@gmx.net>
MFC after:	1 week
2005-01-11 08:51:21 +00:00
Warner Losh
9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Ruslan Ermilov
eccea571a7 Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00
David Malone
f137c9c100 Fix some style bugs I introduced pointed out by bde. Also add a blank
line after the empty variable declarations.

Reviewed by:	md5
2004-06-23 08:26:31 +00:00
David Malone
60e52383e7 Use nanoseconds and then lexicographic ordering when the seconds of
the [acm]time are the same. I was going to use Scott's patch, but I
couldn't get the style quite right, so I used a patch of my own.

Submitted by:		Scott Mitchell <scott+freebsd at fishballoon.org>
MFC after:		3 weeks
2004-06-22 16:02:29 +00:00
David Schultz
70bad4f75b If we are asked to print the total number of blocks, do so even if we
have no entries to print (either due to an empty directory or an
error).  This makes the -l and -s options more consistent, like
Solaris and (Debian) Linux.  To make this happen, tweak two
optimizations on the second call to display():

- Don't skip display() altogether, even if list == NULL.
- Don't skip the call to the printfn in display() if we
  need to print the total.

PR:	45723
2004-06-08 09:30:10 +00:00
David Schultz
48a91b69b8 Remove from the printfns the assumption that dp->list != NULL. Even
if there are no entries, these functions may be called to print the
total number of blocks (0) for consistency's sake.
2004-06-08 09:27:42 +00:00
Lukas Ertl
7fcc4669d8 Plug small memory leak.
PR:             bin/67392
Submitted by:   Matthew Emmerton <matt@gsicomp.on.ca>
MFC in:         1 week
2004-06-03 15:04:00 +00:00
Pawel Jakub Dawidek
478aa80510 Use humanize_number(3).
Reminded by:	jhb
2004-05-25 14:53:47 +00:00
Ruslan Ermilov
2d3640781e Punctuation. 2004-05-16 21:34:49 +00:00
Tim J. Robbins
6449b88bf1 Only add the widths together for printable characters in prn_normal();
unprintable characters have a "width" of -1.
2004-05-03 11:48:55 +00:00
Tim J. Robbins
107409f46e Treat filenames as multibyte character strings (according to the current
LC_CTYPE setting) when determining which characters are printable.
This is an often-requested feature.

Use wcwidth() to determine the number of column positions a character
takes up, although there are still a few places left where we assume
1 byte = 1 column position, e.g. line-wrapping when handling the -m option.

The error handling here is somewhat more complicated than usual: we do
our best to show what we can of a filename in the presence of conversion
errors, instead of simply aborting.
2004-05-02 11:25:37 +00:00
Mark Murray
6195fb4102 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
Bosko Milekic
263377339c Stop iterating over ACLs if we've already determined we
will print them (i.e., number of successful calls to acl_get_entry()
exceeds 3).  This makes O(1) what was O(num_TYPE_ACCESS_ACLs).

This is a slightly modified version of submitter's patch.

PR: bin/65042
Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
2004-04-03 16:55:56 +00:00
Tim J. Robbins
f791df19bd Document incorrect handling of multibyte characters in filenames. 2004-03-21 11:16:24 +00:00
Colin Percival
310924af3d Fixes to output of ls -lh for certain file sizes:
1. Sizes in the range 1000 -- 1023 units require four characters width
   for the integer; increase the field width to accomodate this.
2. Sizes in the range 9.95 -- 10 units were being displayed as "10.0"
   units; adjust the logic to fix this, and now that we've got an extra
   character of field width, print fractional units if the size is less
   than 99.95 units.
3. Don't display sub-byte precision.

This should mean that the following sizes are displayed:
    0B .. 1023B
  1.0U ..  9.9U
 10.0U .. 99.9U
  100U .. 1023U
for values of U in "KMGTPE".

PR:		bin/63547
Pointy hat to:	cperciva
Approved by:	rwatson (mentor)
2004-03-01 19:25:27 +00:00
Colin Percival
d3b68bf14c Fix alignment of size field in ls -lh -- the width was being computed
from log[10](largest file size), but when outputting in human-friendly
format the width is always at most 4. (eg. "123K", " 12K", "1.2K".)

PR: bin/59320
Approved by: rwatson (mentor)
2004-01-22 04:33:00 +00:00
David E. O'Brien
d5f9f41c7b Do something sensible if both -h and -k are given.
Approved by:	re(scottl)
2003-12-01 19:10:29 +00:00
Tim J. Robbins
c5bc87095b Handle realloc() failure correctly. 2003-10-16 07:07:20 +00:00
Tim J. Robbins
bc458f6637 Add the -m, -w and -x options to ls's usage message.
PR:		51493
Submitted by:	Walter Belgers
MFC after:	1 month
2003-09-09 12:02:52 +00:00
Jens Schweikhardt
a3c75939e8 Note in STANDARDS that -gno are not (yet?) POSIX conformant.
Spotted by:	harti
MFC after:	3 days
2003-08-08 17:04:17 +00:00
Christian Brueffer
d18ff742dc -l prints all permissions, not just owner and group
PR:		54294
Submitted by:	Per Hedeland <per@hedeland.org>
MFC after:	3 days
2003-07-10 20:53:56 +00:00
Mark Murray
eac4bdcca4 Get this area compiling with the highest WARNS= that it works with.
Obsolete WFORMAT= junk also removed where possible.

OK'ed by:	obrien
Tested on:	sparc64, alpha, i386
2003-06-13 07:04:02 +00:00
Tom Rhodes
bf88fa9352 df(1) and ls(1) print units in 'four or fewer' not 'three or less'.
PR:		35523
Submitted by:	Tomas Svensson <tsn@gbdev.net>
2003-05-06 21:54:46 +00:00
Mark Murray
40feca3a99 Fix a bazillion warnings. This makes almost the whole of src/bin/*
WARNS=6, std=c99 clean.

Tested on:	i386, alpha
2003-05-03 16:39:34 +00:00
Robert Watson
317f1d53c8 When mac_from_text() fails with -Z, print "-" rather than "" so that
scripts parsing ls(1) output can still count columns.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-26 02:31:26 +00:00
Chris Costello
d2e59e8d5d Reference maclabel(7).
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-20 21:25:00 +00:00
Tim J. Robbins
3fceb9fd5b pathconf() and acl_get_file() follow links so they cannot be used to
determine whether a symlink has an ACL. Instead, assume that symbolic
links don't have ACLs and don't bother checking. Avoids spurious
ENOENT warnings when listing directories containing broken symlinks
on filesystems with ACLs enabled.

Pointed out by:	rwatson, bde
2002-12-19 01:13:23 +00:00
Robert Watson
3c3f5f9cab Improve handling of symlink targets when listing MAC labels: don't
do the wrong thing when the symlink doesn't have a target, by
considering !f_label in the construction of ch_options.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-12-18 21:05:15 +00:00
Ruslan Ermilov
1734e39a1a mdoc(7) police: markup fixes.
Approved by:	re
2002-11-25 13:52:57 +00:00
Tim J. Robbins
e09fdabddf Use warn() instead of perror() or fprintf() where appropriate. 2002-11-06 01:18:12 +00:00
Tim J. Robbins
dd9aaeb0f7 Print a `+' character after the standard UNIX permission fields in long
listings if the file has an extended ACL (more than the required 3 entries).
This is what Solaris and IRIX do, and what the withdrawn POSIX.2c standard
required.

Reviewed by:	rwatson (an earlier version of the patch)
2002-11-03 07:29:08 +00:00
Garrett Wollman
688dfe4533 Do not include <sys/syslimits.h> directly; it is not intended for general
consumption.
2002-10-27 17:44:33 +00:00
Robert Watson
4df6daba42 Attempt improved use of fts results: use the correct path to the
object to retrieve label information on, rather than directly
consuming the fts-provided paths (none of which are quite right).
This is based on the similar readlink() code, and may contain
the same bugs.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-24 01:01:53 +00:00
Robert Watson
4d33b62edc Teach "ls -Z" to use the policy-agnostic MAC label interfaces rather
than the LOMAC-specific interfaces for listing MAC labels.  This permits
ls to view MAC labels in a manner similar to getfmac, when ls is used
with the -l argument.  Next generation LOMAC will use the MAC Framework
so should "just" work with this and other policies.  Not the prettiest
code in the world, but then, neither is ls(1).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-24 00:07:30 +00:00
Mark Murray
ca2993fb41 Constify, staticify, rationalise types and fix other related warnings. 2002-10-23 10:20:01 +00:00
Mark Murray
099bda679e Constify to squash some warnings. 2002-10-23 10:15:44 +00:00
Tim J. Robbins
1656f85050 Print non-printing characters in directory names, as well as file names,
as `?' or `\ooo', depending on whether the -b or -B flags were used.

PR:		43995
MFC after:	1 month
2002-10-18 10:59:45 +00:00
Dima Dorfman
598420ee63 Output "human-readable" values with a non-0 precision where
appropriate.  Before this, a 2.9 GB file was misleadingly reported as
"2G".  This mostly brings unit_adjust() in line with what is in du(1).

Reviewed by:	jmallett
Approved by:	nik
2002-10-18 04:06:59 +00:00
Garrett Wollman
0d3bcc2e80 Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI.  FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about.  As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use.  All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch
2002-09-21 01:28:41 +00:00
Giorgos Keramidas
872b3fe268 Fix a warning of "possibly used before initialisation".
Reviewed by:	tjr
2002-08-29 14:29:09 +00:00
Philippe Charnier
0d9f1a69d8 Replace various spellings with FALLTHROUGH which is lint()able 2002-08-25 13:01:47 +00:00
Tom Rhodes
7d971bbf29 s/filesystem/file system/ as discussed on -developers 2002-08-21 17:32:44 +00:00
Ruslan Ermilov
84a0a0eeac mdoc(7) police: fixed the document date.
Submitted by:	iedowse
2002-08-19 07:15:20 +00:00
Jens Schweikhardt
2b239dd118 Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
Matthew Dillon
5ad9e45f96 err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the usage to make buildworld work again.
2002-07-10 20:44:55 +00:00
David E. O'Brien
5eb43ac2f7 Consistently use __FBSDID 2002-06-30 05:13:54 +00:00
Tim J. Robbins
a28edf9a4a Ignore empty COLUMNS environment variable. COLUMNS should take precedence
over TTY width found via ioctl() (SUSv3)
2002-06-04 10:11:29 +00:00
Ruslan Ermilov
3f0e2b01ff mdoc(7) police: markup nits. 2002-05-29 15:09:49 +00:00
Tim J. Robbins
94274c73cb Add missing options required by SUSv3:
-m	List files across the page, separated by commas.
-p	Print a slash after directory names
-x	Same as -C but sort across the columns rather than down

Submitted by:	Kyle Martin <mkm@ieee.org>
2002-05-19 02:51:36 +00:00
Tom Rhodes
ebd4324457 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
Bill Fumerola
568dcd5fca restore missing default case removed in ls.c:r1.57
add break statements to default cases where missing.

Submitted by:	bde
2002-05-15 18:53:56 +00:00
Juli Mallett
0928a7f16f Make 'user' and 'group' const as to not discard the qualifier from the
functions we use to assign them.  Doesn't seem to be anything else that
relies on these being non-const.
2002-05-15 09:49:59 +00:00
Juli Mallett
ff5e253326 Remove an empty default case to make this syntactically correct. Not there
is as good as blaknk.
2002-05-15 09:43:52 +00:00
Philippe Charnier
093e3ce74f ls(1) is utility not function 2002-04-16 20:03:54 +00:00
John W. De Boskey
b744b6caf9 Document option to option dependancy. Fix typo.
MFC after:	1 week
2002-04-15 02:21:12 +00:00
Ruslan Ermilov
9f1207d517 Install sys/security/lomac/*.h to /usr/include/security/lomac/.
Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR:		docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>.  Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers.  Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR:		bin/28002

Prodded by:	bde
MFC after:	2 weeks
2002-03-26 16:05:14 +00:00
Robert Watson
7774db9751 NAI DBA update. 2002-03-14 21:51:00 +00:00
Andrey A. Chernov
5f7ca9ae38 Add (unsigned char) cast lost in WARNS=4 fixes which break 8bit locales
PR:		35421
2002-02-28 18:52:47 +00:00
Bruce Evans
434b6ea45a #include <time.h> for the definition of time functions instead of
depending on namespace pollution 2 layers deep in <sys/stat.h>.

Removed unused includes.
2002-02-25 01:36:59 +00:00
Warner Losh
576541a9e6 Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
Kris Kennaway
6a99036a7f Correct inadvertent style botches in previous commit. 2002-02-04 03:06:51 +00:00
Kris Kennaway
afe781faa2 Lock down with WFORMAT=1 except those directories with unfixed warnings.
Tested on i386 and alpha.
2002-02-04 02:49:19 +00:00
Mark Murray
c73d77cef9 Use __FBSDID() and clean up the vendor tags. 2002-02-03 20:55:54 +00:00
Mark Murray
9052855a15 WARNS=4 fixes, plus a healthy dose of fixes inspired by lint. 2002-02-03 19:11:32 +00:00
Warner Losh
900021ae8e Fix unused variable. 2002-02-02 07:10:02 +00:00
Warner Losh
46251dde8f o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
Ruslan Ermilov
127713f491 mdoc(7) police: tidy up. 2002-01-09 13:29:39 +00:00
Bruce Evans
baa7ecb561 Fixed style bug (unsorting of SRCS) in rev.1.15. 2001-12-29 12:05:30 +00:00
Bruce Evans
31d680507a Fixed style bugs in revs. 1.6, 1.10 and 1.12. 2001-12-29 11:59:26 +00:00
Bruce Evans
95ca089fac Fixed missing DPADD and disordered LDADD in rev.1.17
Fixed setting of WARNS in rev.1.16.  Options should normally be set using
using "?=", not using "=", so that the setting is easy to override on the
command line, and setting WARNS to 0 should not be an exception.
2001-12-29 11:51:27 +00:00
Josef Karthauser
ac639e9072 LSCOLOURS should be spelt LSCOLORS.
Submitted by:	Jordan DeLong <fracture@allusion.net
2001-12-29 10:13:43 +00:00
Ben Smithurst
887f28b380 Remove part of a diff committed at the end of the file. 2001-12-29 00:51:23 +00:00
Josef Karthauser
47f884f098 Force raw printing of non-printable characters via the -w option.
PR:		bin/28007
2001-12-29 00:22:29 +00:00
Josef Karthauser
5dda5d0df0 Restore these files to shiny KNF. 2001-12-29 00:18:16 +00:00
Josef Karthauser
b95a83b308 Convert some spaces into tabs that I missed first time around. 2001-12-28 21:55:23 +00:00
Josef Karthauser
7b3360c0e2 Revert most of rev 1.42, to restore KNF style.
Requested by:	bde
2001-12-28 21:47:33 +00:00
Josef Karthauser
0e8d1551e0 Add a new flag, -h which when combined with the -l option causes
file sizes to be displayed with unit suffixes; Byte, Kilobyte,
Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the
number of digits to three or less.

Submitted by:	nik
2001-12-28 20:50:12 +00:00
Josef Karthauser
130d15dc43 Make it clearer what changed to a user using the old format of LSCOLORS. 2001-12-28 19:27:30 +00:00
Josef Karthauser
6bd042dfe9 Mop up some warnings. 2001-12-28 19:26:06 +00:00
Josef Karthauser
b0bc91e955 Make the style more consistent throughout the file. 2001-12-28 18:43:32 +00:00
Josef Karthauser
0d72516e58 Use the default colour instead if a bad colour specification is given. 2001-12-28 18:20:23 +00:00
Josef Karthauser
c1499cf6cf Revamp the colour support to allow for bold characters. Colours
are now defined using the characters a-h and A-H for the bold
variants.  The old way using 0-7 for the colours still works, but
prints a message asking the user to switch.

PR:		bin/27374
2001-12-28 18:14:50 +00:00
Giorgos Keramidas
c602ea21d7 Make a bit more clear the types of characters that -B option will
print in octal.

Reviewed by:	roam, silence on -doc
2001-12-06 00:30:53 +00:00
Ruslan Ermilov
b5f8218042 mdoc(7) police: s/LKM/KLD/, sort xrefs. 2001-12-04 14:17:52 +00:00
David E. O'Brien
a748290789 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
Brian Feldman
7304f61f9e Add LOMAC options (the "Z" flag in both cases) to display extra information
in ls(1) and ps(1).

Sponsored by:	DARPA, NAI Labs
2001-11-26 22:21:15 +00:00
Ruslan Ermilov
d628d776c4 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
Dima Dorfman
7176351c92 Don't use the pronoun "you".
Reviewed by:	sheldonh, mpp
2001-07-23 09:46:17 +00:00
Dima Dorfman
f4c77bb846 Don't put a shell prompt in the example since none of the other man
pages do it.  Also, don't use brackets to indicate optional options in
the example; instead, add a paragraph below the example explaining it.
2001-07-22 10:33:31 +00:00
Ben Smithurst
3c98bba995 Add missing closing parenthesis. 2001-07-21 05:33:33 +00:00
David E. O'Brien
703bf76847 Show an example of how to sort a file listing by size. Hopefully this
will reduce the number of people calling for this functionality to be
added to ls(1).
2001-07-21 05:01:50 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
3c4869d927 Drop support for -DRELEASE_BUILD_FIXIT and -DCRUNCHED_BINARY in
${CFLAGS}.  The only supported method thus is -DRELEASE_CRUNCH.
2001-04-03 13:34:35 +00:00
Andrey A. Chernov
8234eb2519 Silence minor cc warning 2001-03-21 15:14:47 +00:00
Andrey A. Chernov
28fd017a11 Use nl_langinfo instead of %Ef 2001-03-21 13:21:20 +00:00
Ruslan Ermilov
47dec78170 mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Tim Vanderhoek
00dfd8785a grammar gnit: "relationships (plural) _are_ complex" 2000-12-28 17:17:49 +00:00
Ruslan Ermilov
12e720d78b Prepare for mdoc(7)NG. 2000-12-15 17:37:31 +00:00
Ruslan Ermilov
be8b149795 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 11:39:41 +00:00
Josef Karthauser
d4413063b3 Un-deprecate the -G flag at obrien's request. Colour sequences are still
dependent upon the output being directed to a terminal however.
(Use the CLICOLOR_FORCE variable to force output).
2000-08-13 12:17:03 +00:00
Josef Karthauser
74e6090127 Correct spelling: depricated -> deprecated. 2000-08-12 23:53:11 +00:00
Josef Karthauser
3d2ddc9e1a A change to the way that colours are switched on in ls. The -G
flag has been depricated, although it still works with a warning
message, and replaced with an environment variable CLICOLOR (command
line interface colour).  This could be used by other tools that
want to be able to control colour output.

In addition if the environment variable CLICOLOR_FORCE is defined
colour sequences are output irrespective of whether the output is
directed to a terminal (as long as TERM references a colour capable
terminal of course ;)

PR:	bin/20291 and bin/20483
2000-08-12 22:40:14 +00:00
Josef Karthauser
aab56c46b2 ".It" -> ".It Ev" in a couple of places. 2000-08-12 21:10:11 +00:00
Brian Feldman
133099f36c Add the missing flags to ls(1)'s usage: -Bb. 2000-07-22 05:28:46 +00:00
Sheldon Hearn
16481ad9d4 Explain the dependence of colour support on the capabilities of the
terminal emulator.

As pointed out by jhb, a more scalable solution would be preferable
when multiple applications in the base system begin linking against
libh.

Submitted by:	Doug Barton <DougB@gorean.org>
2000-07-07 14:46:13 +00:00
Assar Westerlund
ee579ffbea make sure we do not write out non-printable characters in file names
and symbolic links (by default)

PR:		bin/19354
Reviewed by:	silence on -current
2000-07-04 23:09:23 +00:00
Sheldon Hearn
728a64be3f Fix changes from 1.34 through 1.37:
Remove newly added hard sentence breaks.
Mark ANSI up as a type name (Tn).
Avoid parenthesized sentences and paragraphs.
2000-06-22 10:07:46 +00:00
Josef Karthauser
e5516847ea Order the ENVIRONMENT section alphabetically. 2000-06-21 21:56:50 +00:00
Josef Karthauser
1e715e3437 I broke locale sensitive ordering of date and month in
the long -l output format with the last commit.  Fix it
by replacing the "%b %e" strftime format with "%Ef".

Make a note in the manual page that the LANG environment
variable affects the running of ls.

Reviewed by:	ache
2000-06-21 21:49:57 +00:00
Josef Karthauser
97e4e97bd1 Don't assume that the output of strftime for "%c" ("national
representation of time and date") won't change in time.  Instead
of hard coding the locations of the time elements and hoping that
they don't move use strftime to generate the desired formats in
the first place.

PR:	bin/7826
2000-06-18 22:18:04 +00:00
Josef Karthauser
141d77b8cb Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
Andrey A. Chernov
18d8a22b61 Fix one conditionalization in my prev. commit 2000-06-06 13:02:52 +00:00
Andrey A. Chernov
22ff3e9e29 Greately simplify oxtabs fix by simple setting f_notabs for f_color 2000-06-06 12:44:29 +00:00
Andrey A. Chernov
322b47fd88 Honor f_notabs flag even in COLORLS 2000-06-06 12:25:17 +00:00
Andrey A. Chernov
6cd5adff75 Back out spaces to TABs replace removing for COLORLS
Rewrite corresponding comment to say what happens in reality with oxtabs
and current terminal column.
2000-06-06 12:10:07 +00:00
Andrey A. Chernov
82dd3eab13 Don't replace TABs with spaces for COLORLS because "some terminals get confused"
as comment says. I know no terminal confused by this. If even such terminal
exists, it must be termcap flag for this, not hardcoded in ls.
2000-06-06 07:32:20 +00:00
Andrey A. Chernov
a04eaf5b2e Add -G to usage: if COLORLS 2000-06-06 07:29:43 +00:00
Andrey A. Chernov
1bf1478a9f Staticize more functions 2000-06-06 07:19:50 +00:00
Andrey A. Chernov
fd4e4d608f Move colorquit() prototype to extern.h
Add "extern" to variables declarations in extern.h to not make them
commons into each compiled file.
2000-06-06 07:14:01 +00:00
Andrey A. Chernov
38782c258d Make signal handler safe - don't use stdio (pointed by bde)
Staticize some color functions
Add yet one tolower() call which is forgotten after check
Don't check for OOPS - not really needed
2000-06-06 06:52:03 +00:00
Andrey A. Chernov
4304e142c2 Reflect reality:
yellow -> brown
white -> light grey
2000-06-06 00:42:24 +00:00
Andrey A. Chernov
c85e2c8e57 Get rid of curses completely - use tgoto instead of tparm 2000-06-05 20:54:46 +00:00
Martin Cracauer
ab08444f95 Do SIGINT cleanup for SIGQUIT as well. 2000-06-05 20:38:47 +00:00
Andrey A. Chernov
faebfe2e07 Kill yourself in ^C handler, not exit(1) to allow script to sense signal 2000-06-05 20:08:50 +00:00
Andrey A. Chernov
47bb6b11f3 Cosmetique of prev. optimization - don't use global variable 2000-06-05 19:56:52 +00:00
Andrey A. Chernov
cf0feaeee9 Don't use curses includes, include termcap.h instead
Don't use curses functions, use tputs instead
Add ^C reaction - reset colors
Optimization - don't turn off colors after EACH file printed.
Fix wrong ctype macro arg type in LSCOLORS parsing
2000-06-05 19:39:39 +00:00
Andrey A. Chernov
bd82d8ab8f Don't use curses includes, include termcap.h instead
Add ^C reaction set
2000-06-05 19:36:06 +00:00
Andrey A. Chernov
ecb7192ace Don't use ncurses, use termcap
Add DPADD
2000-06-05 19:34:31 +00:00
Josef Karthauser
5a890e22bf Don't look up the ANSI sequences each time a colour is changed,
this is extremely inefficient, instead write them all down at the
beginning.

The correct sequence to switch colours off is to first use 'op' if
it exists, otherwise use 'oc'.  If neither of these exist then we
shouldn't be doing colour with this terminal.

Reviewed by:	ache
2000-06-05 03:51:29 +00:00
Josef Karthauser
3ad254b3de Disable colour support in ls when building the fixit floppy, and make
a note of it in the release Makefile.
2000-06-05 02:25:55 +00:00
Josef Karthauser
74985094ef * Re-implement colour support using termcap's AF and AB capabilities
to manage the ANSI colour sequences.  Colour support is disabled
  unless the TERM environment variable references a valid termcap.

* Allow optional compilation of the colour support in the Makefile,
  defaulting to yes.  This allows us to switch it off for fixit
  floppies and other mediums where space is an issue and the extra
  bloat of statically linking with ncurses isn't acceptable.

* Display a warning if colour is requested with '-G' but support
  for it isn't compiled in.
2000-06-05 02:14:01 +00:00
Josef Karthauser
3885812c8c Add colour support to /bin/ls (at a cost of 1056 bytes on my system).
It is not switched on by default and must be enabled with the -G
flag.  When using ls -G the output behaviour is modified with ANSI
colour sequences wrapped around filenames to help distinguish file
types.  (Colours can be redefined in the LSCOLORS environment
variable as described in the manual page.)

Colour support is silently disabled (if switched on) if stdout
isn't a tty.

Based on:	asami's colorls port.
PR:		bin/18900 && ports/18616.
2000-06-02 14:53:42 +00:00
Sheldon Hearn
4e86fcacf6 Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
Sheldon Hearn
bef84d6bc0 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 10:43:09 +00:00