summaryrefslogtreecommitdiffstats
path: root/include/optutils.h
Commit message (Collapse)AuthorAgeFilesLines
* optutils.h: don't print non-graph charactersJ William Piggott2017-04-191-3/+4
| | | | | | | | | | | | | | | There is no eloquent way to exclude/include arch dependent arguments from the ul_excl_t array. So when an arch dependent argument is left undefined err_exclusive_options() was printing out-of-bounds values. This commit cause them to be skipped instead. err_exclusive_options() shouldn't be printing out-of-bounds values in any case. Also change the error massage from 'options' to 'arguments' as some programs, like hwclock, distinguish between options and functions. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* include: fix compiler warningSami Kerola2017-03-131-0/+3
| | | | | | | | | | | | | | ./include/optutils.h:12:18: warning: null pointer dereference [-Wnull-dereference] for (o = opts; o->name; o++) ~^~~~~~ In file included from libfdisk/src/dos.c:12:0: ./include/pt-mbr.h:25:47: warning: potential null pointer dereference [-Wnull-dereference] return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); ~^~~ Well these should be impossible, so add assert() to catch possible bugs. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/optutils: fix typoKarel Zak2014-08-281-1/+1
| | | | | Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: remove some inconsistent periods from error messagesBenno Schulenberg2014-08-111-4/+4
| | | | | | While doing so, also improve translatability and some wordings. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* include/optutils: make collisions detection between options more robustKarel Zak2013-03-131-4/+12
| | | | | | | - don't rely on the correct ul_excl_t usage - don't print --(null) for non-existing long options Signed-off-by: Karel Zak <kzak@redhat.com>
* include/optutils: remove unnecessary exclusive_option()Karel Zak2012-07-261-14/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/optutils: add err_exclusive_options()Karel Zak2012-07-261-0/+75
| | | | | | | | | | | This is improved implementation of exclusive_option(). The new implementation: - uses regular struct option to compose error messages - relationships between options are described in one const static array - the current status is stored in one int array Signed-off-by: Karel Zak <kzak@redhat.com>
* include [optutils]: add exclusive_option() inline functionSami Kerola2012-06-171-0/+19
| | | | | | | The exclusive_option() will unify how exclusive options are determined. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include,optutils: add option_to_longopt()Karel Zak2011-11-291-0/+15
Signed-off-by: Karel Zak <kzak@redhat.com>