summaryrefslogtreecommitdiffstats
path: root/term-utils/setterm.c
diff options
context:
space:
mode:
authorSami Kerola2015-02-22 15:41:37 +0100
committerKarel Zak2015-02-24 11:33:31 +0100
commite5cf14765502931f7a89c95feee712e27f9003cc (patch)
treeb1ac1fddeb5091b5d6790ca4f09c9ad23812df97 /term-utils/setterm.c
parenttunelp: remove unnecessary preprocessor directives (diff)
downloadkernel-qcow2-util-linux-e5cf14765502931f7a89c95feee712e27f9003cc.tar.gz
kernel-qcow2-util-linux-e5cf14765502931f7a89c95feee712e27f9003cc.tar.xz
kernel-qcow2-util-linux-e5cf14765502931f7a89c95feee712e27f9003cc.zip
lib/strutils: move parse_switch() from setterm(1) to library
To allow sharing the code with other utilities. Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/setterm.c')
-rw-r--r--term-utils/setterm.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 76fedbae4..fed25307c 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -178,20 +178,6 @@ struct setterm_control {
opt_powerdown:1, opt_blength:1, opt_bfreq:1;
};
-/* Command line parsing routines.
- *
- * Note that it is an error for a given option to be invoked more than once.
- */
-
-static int parse_switch(const char *arg, const char *t, const char *f)
-{
- if (strcmp(arg, t) == 0)
- return 1;
- else if (strcmp(arg, f) == 0)
- return 0;
- errx(EXIT_FAILURE, _("argument error: %s"), arg);
-}
-
static int parse_febg_color(const char *arg)
{
int color;
@@ -687,8 +673,6 @@ static void parse_option(struct setterm_control *ctl, int argc, char **argv)
}
}
-/* End of command line parsing routines. */
-
/* Return the specified terminfo string, or an empty string if no such
* terminfo capability exists. */
static char *ti_entry(const char *name)