Page MenuHomeFreeBSD

indent(1): add option -P for loading user-provided files as profiles
ClosedPublic

Authored by pstef on Dec 31 2016, 12:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 17, 10:00 PM
Unknown Object (File)
Sat, Aug 17, 4:46 AM
Unknown Object (File)
Wed, Aug 7, 6:45 AM
Unknown Object (File)
Tue, Aug 6, 9:46 AM
Unknown Object (File)
Mon, Jul 29, 9:08 PM
Unknown Object (File)
Jul 10 2024, 5:46 AM
Unknown Object (File)
Jun 27 2024, 3:03 PM
Unknown Object (File)
Jun 23 2024, 12:51 PM
Subscribers
None

Details

Summary

Without this patch, indent(1) will 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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pstef retitled this revision from to indent(1): add option -P for loading user-provided files as profiles.
pstef updated this object.
pstef edited the test plan for this revision. (Show Details)
args.c
102 ↗(On Diff #23489)

The option "V" is an artefact from my local changes that I'm not going to commit; pay no attention to it.

Given that there is a "-npro" option already, how about renaming it to "-ppro"? This would stand for "personalized profile", but I guess we could use custom profile (-cpro) or temporary profile (-tpro). Just trying to make things look consistent ;).

args.c
102 ↗(On Diff #23489)

Please rebase the diff on top of the FreeBSD version. You will need that to commit it anyway.

indent.1
69 ↗(On Diff #23489)

When updating content for a manpage you should also update the date on the top of this file.

Given that there is a "-npro" option already, how about renaming it to "-ppro"? This would stand for "personalized profile", but I guess we could use custom profile (-cpro) or temporary profile (-tpro). Just trying to make things look consistent ;).

The lower-case options either take no parameter or take a numeric parameter. Only special options (upper-case, single letter) -U and -T take parameters in string form.

args.c
102 ↗(On Diff #23489)

Will do.

indent.1
69 ↗(On Diff #23489)

Will do.

"-P" is OK then.
I can't check easily the length of the lines in phabricator but it's probably fine too as I see longer lines in the original code.

pstef edited edge metadata.
pstef removed rS FreeBSD src repository - subversion as the repository for this revision.

Rebased on top of SVN.
Updated date in the man page.

Approved: however, do remember to add a line

Differential Revision: Revision URL

as the last line in your log.

indent.c
101 ↗(On Diff #23557)

It is not strictly wrong, as this code has it's own style, but just FYI:

Per our style, initialization should be done in line 194, right before profile_name is used. However, this program has an initialization section so it should be there.

OTOH, they also do some initializations in the declaration section, so you can leave it there :-P.

pfg edited edge metadata.
This revision is now accepted and ready to land.Jan 2 2017, 7:48 PM
This revision was automatically updated to reflect the committed changes.