summaryrefslogtreecommitdiffstats
path: root/Documentation/boilerplate.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add optional option back to struct optionSami Kerola2017-07-151-8/+9
| | | | | | | | The line was accidentally removed in the reference commit where only the short option had to go. Rest of the change is indentation. Reference: 326c5c93b917a623f346155c8b3438b379d9fd60 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: update boilerplate.c usage()J William Piggott2017-07-101-18/+17Star
| | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(FILE*)Ruediger Meier2017-06-261-3/+4
| | | | | | | | | | | | | | This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Docs: add a comment for constants to boilerplate.cJ William Piggott2017-06-241-3/+5
| | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
* docs: add program-desc to howto-usage-function.txt and boilerplate.cKarel Zak2017-06-211-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add usage() functions headingJ William Piggott2017-06-211-0/+3
| | | | | | | | | | | Make a functions heading, similar to the existing options heading. * include/c.h: define USAGE_FUNCTIONS * Documentation/boilerplate.c: add USAGE_FUNCTIONS * sys-utils/hwclock.c add functions header to usage() Reviewed-by: Karel Zak <kzak@redhat.com> Signed-off-by: J William Piggott <elseifthen@gmx.com>
* docs: improve boilerplate.c options exampleSami Kerola2017-03-131-6/+7
| | | | | | | Make usage() translations to contain complete option help in single translation unit. And make -z option example complete. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-9/+9
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-1/+1
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: optinal option arguments should be long-onlySami Kerola2016-04-171-5/+5
| | | | | | | | | | | Deprecate adding new short optional option arguments. They are problematic. Proposed-by: Ruediger Meier <sweet_f_a@gmx.de> Acked-by: Karel Zak <kzak@redhat.com> Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Reference: https://lists.gnu.org/archive/html/coreutils/2012-11/msg00004.html Reference: http://marc.info/?l=util-linux-ng&m=146062997618853&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: add a new command boilerplate codeSami Kerola2014-03-121-0/+100
Having howtos is good, having an working code that can be used as-is to kickstart a write of a new command is better. Signed-off-by: Sami Kerola <kerolasa@iki.fi>