Commit Graph

46 Commits

Author SHA1 Message Date
Piotr Pawel Stefaniak
bb92a28b2f indent(1): rename -nsac/-sac ("space after cast") to -ncs/-cs
Also update tests and the manpage.

GNU indent had the option earlier as -cs, let's not diverge unnecessarily.
2018-06-11 05:35:57 +00:00
Piotr Pawel Stefaniak
d0f86f663f indent(1): add --version option
There exist multi-platform programs that check indent's version in order to
know what they can expect from it. GNU indent provides that via --version,
so implement the same option here.
2018-06-04 21:05:56 +00:00
Piotr Pawel Stefaniak
aac30b753f indent(1): new option -lpl
With -lpl, code surrounded by parentheses in continuation lines is lined up
even if it would extend past the right margin.

With -nlpl (the default), such a line that would extend past the right
margin is moved left to keep it within the margin, if that does not require
placing it to the left of the prevailing indentation level.

These switches have no effect if -nlp is selected.

Submitted by:	Tom Lane
2018-06-03 21:40:38 +00:00
Piotr Pawel Stefaniak
50a2976094 indent(1): revert introduction of -lpl
That was committed with the wrong message. Will be re-added.
2018-06-03 21:34:29 +00:00
Piotr Pawel Stefaniak
971e1c47ec indent(1): new option -lpl (always line up to parenthesis)
With -lp, if a line has an opening paren which is not closed on that line,
then continuation lines will be lined up to start at the character position
just after the opening paren.

Submitted by:	Tom Lane
2018-06-03 20:59:59 +00:00
Piotr Pawel Stefaniak
5834814ee8 indent(1): manual page corretions
Add missing options, synchronize syntax summary with the actual option list,
and other fixes.

Submitted by:	Tom Lane
2018-06-03 20:48:58 +00:00
Piotr Pawel Stefaniak
1479f36d8e indent(1): remove troff output support
The troff output in indent was invented at Sun and the online documentation
for some post-SunOS operating system includes this:
The usual way to  get  a  troffed listing is with the command
                       indent -troff program.c | troff -mindent

The indent manual page in FreeBSD 1.0 already lacks that information and
troff -mindent complains about not being able to find the macro file.
It seems that the file did exist on SunOS and was supposed to be imported
into 4.3BSD together with the feature, but that has never happened.

Removal of troff output support simplifies a lot of indent's code.

vgrind(1) seems to be a promising replacement.
2018-06-03 17:55:50 +00:00
Kyle Evans
c6841b079b Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
Instead of using a non-configurable ".BAK" suffix, respect the
SIMPLE_BACKUP_SUFFIX environment variable also used by patch(1). This
simplifies cleanup operations in some patch/indent workflows.

Reviewed by:	cem (earlier version), emaste, pstef
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D10921
2017-08-07 18:01:27 +00:00
Piotr Pawel Stefaniak
fbdbd284ae indent(1): add option -tsn for setting tab size. 2017-07-25 17:04:35 +00:00
Piotr Pawel Stefaniak
86adac04b2 indent(1): add option -P for loading user-provided files as profiles
Without this change, indent(1) would only look to load options from ~/.indent.pro if it's there and -npro wasn't used on the command line. This option lets the user set their own path to the file.

Approved by:	pfg (mentor)
Differential Revision:	https://reviews.freebsd.org/D9010
2017-01-02 20:23:46 +00:00
Pedro F. Giffuni
bde60d7544 indent(1): remove unneeded comma.
It is not a good practice to start a newline with a comma anyways.

Discussed with:	 bjk
Differential Revision:	https://reviews.freebsd.org/D8690
2016-12-04 03:10:25 +00:00
Pedro F. Giffuni
86bd08e9ee Document undocumented indent(1) options badp/nbadp, bs/nbs, and lc.
Submitted by:	 Piotr Stefaniak
Differential Revision:	https://reviews.freebsd.org/D8690
2016-12-03 00:24:34 +00:00
Pedro F. Giffuni
771aff0aa5 indent(1): add new -sac and -U options.
Add -sac (space after cast) and -nsac options.
These control whether space character is put after a cast operator or not.
Default is -nsac.

Add -U option for providing a file containing list of types.
This is needed for properly deciding which asterisks denote unary
operation and which denote binary.

These come from PostgreSQL.

Reference:
84b00e3d46
49c52cf383

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by:	Piotr Stefaniak
2016-08-03 22:08:07 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Eitan Adler
dda5b39711 multiple: Remove 3rd clause from BSD license where approved by the
regents and renumber.

This patch skips files in contrib/ and crypto/

Acked by:	imp
Discussed with:	emaste
2014-03-14 03:07:51 +00:00
Joel Dahl
7e700c30d2 mdoc: minor paragraph fixes. 2014-02-08 13:37:02 +00:00
Joel Dahl
126b754db4 Remove superfluous paragraph macro. 2012-03-25 09:19:25 +00:00
Eitan Adler
d1b25cd91b Document the [n]eei and [n]bacc options
PR:		docs/165009
Submitted by:	Jeremy Huddleston <jeremyhu@apple.com>
Approved by:	bcr
MFC after:	1 week
2012-03-03 18:07:53 +00:00
Andriy Gapon
c58c7416c7 indent(1): add a new option, -ta, to treat all *_t identifiers as types
Submitted by:	Hans Petter Selasky
Discussed with:	bde
MFC after:	10 days
2010-03-31 17:05:30 +00:00
Giorgos Keramidas
6fb9b618f5 Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after:	1 week
Thanks to:	Music band ``Chingon''
		for keeping me company while searching for these.
2005-07-31 03:30:48 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ceri Davies
fa5c581ccf Quote example file names consistently, and fix a small grammatical nit. 2005-02-04 11:37:49 +00:00
Giorgos Keramidas
d8aa7ce5ca Clarify a bit the BUGS section.
PR:		docs/77024
Submitted by:	Adrian Filipi <adrian@ubergeeks.com>
Reviewed by:	ru
2005-02-03 21:16:23 +00:00
Ruslan Ermilov
557b7fa148 Deal with double whitespace. 2004-07-03 00:24:45 +00:00
Ruslan Ermilov
6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Jens Schweikhardt
a6a6666238 Bump document date.
Submitted by:	ru
2004-06-30 19:56:16 +00:00
Jens Schweikhardt
5ac16458a1 Document recently acquired options.
PR:		67983
Submitted by:	Chip Norkus <wd@teleri.net>
MFC after:	2 weeks
2004-06-29 18:57:13 +00:00
Ruslan Ermilov
fc7589061d Fixed document date. 2004-05-19 09:49:54 +00:00
Bruce Evans
a55a608e71 Only indent once for continuation lines when not lining up with
parentheses if the continuation indent is exactly half of the main
indent.  Indenting one contination indent for every level of
parentheses gives bad results in most cases and is not what is done
in about 90% of properly hand-formatted KNF code (sys/kern/*.c,
nvi/common/*.c).  The main advantage of the non-default KNF options
-nlp -ci4 is that continuation lines don't accidentally line up with
the next main indentation level or march to the right, and increasing
their indentation defeats this.

This behaviour change is limited to when the continuation indent is
exactly half of the main indent to avoid adding yet another option.
2004-02-12 16:25:12 +00:00
Bruce Evans
88ce0e7f7e Added an option -ldi<N> to control indentation of local variable names.
The default is to be backwards compatible and non-KNF (use the same
indentation for locals as for globals; -ldi0 gives KNF indentation
for locals (none)).  The indentation for globals also applies to struct
member names in local declatations.  The indentation of variable names
in multi-line declarations is broken in various ways and this commit
gives some new variations.

indent.1:
Also clarified the description of -di<N>.
2004-02-09 21:48:51 +00:00
Philippe Charnier
e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
Dima Dorfman
f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Ruslan Ermilov
625003720a mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 14:16:33 +00:00
David E. O'Brien
1261f234e0 The options I added where not formated to new manpage style specs. 2000-12-09 19:03:21 +00:00
David E. O'Brien
a5e1cac0f5 "Implement -[n]fcb (formatting of block comments) and attempt to implement
no-space=after-sizeof (not optional) and no-space-after 'struct foo *'
(not optional).  Without these, indent unKNFizes even more perfectly KNF code."

Submitted by:	bde
2000-12-09 09:45:09 +00:00
Ruslan Ermilov
8fe908ef0c mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Nik Clayton
3be5f1f5ce Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:24:20 +00:00
Tim Vanderhoek
5b9513b266 Change defaults to match reality.
PR:		docs/3817
1997-10-24 04:13:41 +00:00
Philippe Charnier
958d7c9f1d Use err(3) instead of local redefinition. Add usage(). 1997-07-15 09:50:59 +00:00
Steve Price
287c7db424 Some minor cosmetic tweaks.
PR:			docs/3941
Partially submitted by:	uenami@imasy.or.jp
1997-06-28 19:27:51 +00:00
Marc G. Fournier
ad5123aab3 Fix description of -cli option so that it comes out as -cli0.5 instead of
-cli0 -.5

Submitted by:	 Lars Koeller <Lars_Koeller@odie.physik2.uni-rostock.de>
1996-10-23 07:02:48 +00:00
Mike Pritchard
270d3d754a Fix a variety of minor typos and cross references in a bunch of
man pages.

Masanobu Saitoh <msaitoh@spa.is.uec.ac.jp>
Giles Lean <giles@nemeton.com.au>
<soda@sra.co.jp>
1996-01-20 07:29:11 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00