summaryrefslogtreecommitdiff
path: root/usr.bin/indent/args.c
AgeCommit message (Collapse)Author
2023-06-15indent: miscellaneous cleanups, more tests for edge casesrillig
2023-06-14indent: reduce number of relocationsrillig
Since all command line options modify a member of struct options, there is no need to encode that relocation 38 times. No functional change.
2023-06-10indent: miscellaneous cleanupsrillig
2023-06-05indent: do not report broken lines, report configuration on stderrrillig
2023-06-05indent: rename variables, clean up commentsrillig
No binary change.
2023-05-18indent: rename a few functionsrillig
No functional change.
2023-05-18indent: manually wrap overly long linesrillig
No functional change.
2023-05-18indent: switch to standard code stylerillig
Taken from share/misc/indent.pro. Indent does not wrap code to fit into the line width, it only does so for comments. The 'INDENT OFF' sections and too long lines will be addressed in a follow-up commit. No functional change.
2023-05-14indent: remove foreign RCS IDsrillig
2023-05-14indent: miscellaneous cleanupsrillig
2023-05-13indent: improve names of option variablesrillig
No functional change.
2023-05-13indent: don't try to read from the file '(null)/.indent.pro'rillig
2023-01-20indent: fix misleading commentrillig
2021-11-25indent: make error message for missing command line arguments clearerrillig
2021-11-19indent: reduce casts to unsigned char for character classificationrillig
No functional change.
2021-11-07indent: parse special options strictlyrillig
2021-11-05indent: clean up argument parsingrillig
In struct pro, place the dependent member below its dependency. In load_profile, consistently use -1 when outside a comment. No functional change.
2021-10-31indent: clean uprillig
Initialize buffers in reading order, make comments more expressive, rename add_typename to register_typename, remove unused macro. No functional change.
2021-10-29indent: parse options in a platform-independent wayrillig
Previously, on an ILP32 platform, the option '-ts30000000000000000' resulted in the error message 'must be an integer', on LP64 platforms it resulted in the error message 'must be between 1 and 80'. Remove this unnecessary difference.
2021-10-28indent: clean up indentation, comments, reducerillig
No functional change.
2021-10-28indent: fix error message for buffer overflow during option parsingrillig
At this early time, the input file has not been opened yet, so there is no reason to output either the input file name or the line number.
2021-10-28indent: make error messages for option parsing more preciserillig
2021-10-28indent: parse option '-cli' strictlyrillig
2021-10-28indent: topologically sort functionsrillig
No functional change.
2021-10-28indent: change product name, update version numberrillig
NetBSD's indent has deviated enough from FreeBSD's indent to warrant a different product name. When indent was copied from FreeBSD in 2019, that update introduced several new bugs, some of which have been fixed in the NetBSD version. NetBSD indent, unlike FreeBSD indent, supports C99 comments and C99 initializer designators.
2021-10-26indent: run indent on its own source coderillig
With manual corrections afterwards, to compensate for the remaining bugs in indent. Without the type definitions in .indent.pro, the opening braces of the functions kw_name and lexi_alnum would not be at the beginning of the line.
2021-10-24indent: run indent on its own source coderillig
With manual corrections afterwards. Indent still does not get extra_expr_indent correctly, it also indents global variables after tagged declarations too deep. No functional change.
2021-10-24indent: rename nitems to array_lengthrillig
2021-10-24indent: sort includesrillig
2021-10-17indent: parse int command line options strictlyrillig
On i386 and other platforms where LONG_MAX == INT_MAX, the test t_errors/option_tabsize_very_large failed since the behavior on integer overflow differs between ILP32 and LP64 platforms. Noticed by gson@. Avoid this unintended difference by adding reasonable limits for each of the integer options and by replacing atoi with strtol.
2021-10-13indent: check command line options stricterrillig
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well. Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa. Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
2021-10-08indent: clean up argument handlingrillig
Sort the macros, remove redundancy from comment. Remove redundant lint comment. Lint still does not recognize __attribute__((__noreturn__)), but it also doesn't perform advanced control flow analysis, so there is no point in having the comment, as it doesn't suppress any warnings. No functional change.
2021-10-08indent: unexport add_typedefs_from_filerillig
No functional change.
2021-10-08indent: run indent on indent.hrillig
The formatting looks mostly OK. Some struct members had excessively long names, leaving no space for their corresponding comments. Renamed some of them using well-known abbreviations. The formatting for debug_vis_range is messed up, no idea why. It is clearly a function declaration, not a function definition, so there is no need to place the function name in column 1. No functional change.
2021-10-07indent: rename opt.btype_2 to brace_same_linerillig
No functional change.
2021-10-07indent: fix wrong or outdated commentsrillig
No functional change.
2021-10-07indent: remove global variable option_sourcerillig
It is only needed at startup, while parsing the options. The string "?" was not needed at all. No functional change.
2021-10-07indent: raise WARNS from the default 5 up to 6rillig
2021-10-07tests/indent: test parsing of command line options in profile filerillig
2021-10-07indent: complain if the profile from the command line does not existrillig
2021-10-07indent: allow long comments in profile filesrillig
When reading a comment in a profile file, don't store the characters of the comment in the buffer, just skip them. This allows for long comments without triggering overflow errors.
2021-10-07indent: prevent buffer overflow when reading profilerillig
2021-10-03indent: clean up load_profilerillig
No functional change.
2021-10-03indent: reduce duplicate code in load_profilesrillig
No functional change.
2021-10-03indent: rename functionsrillig
There was no good reason for using the different verbs 'scan' and 'set' for two functions that essentially do the same. No functional change.
2021-10-03indent: fix content of profile_namerillig
Previously, profile_name included the leading "-P", which was confusing.
2021-09-26indent: unexport keyword table, clean uprillig
No functional change.
2021-09-26indent: force all option variables to be in struct optionsrillig
No functional change.
2021-09-26indent: reduce memory usage of the options tablerillig
Almost all boolean options are negatable, so model this directly instead of saving each option twice. This saves memory, is faster and more directly models reality. No functional change.
2021-09-26indent: list options in the same order as in the manual pagerillig
No functional change.