agetty: Fix implementation of option --nonewline. The flag F_NONL was never set.

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
agetty: Update help usage function

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
agetty: update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
mount: fix tiny typo in man page

adjust command to use /dev/loop3 as described in text

Signed-off-by: Stephan Mueller <fruktopus@gmail.com>
setterm: clean up includes

Use klogctl(2) from sys/klog.h just like dmesg(1).  The rest is just
reordering, and indenting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: use getopt_long_only() for option parsing

The getopt_long_only() has advantage of allowing one and two hyphen
versions of options, for example -help and --help.  Secondly the getopt
function family from libc can ensure some options requiring arguments,
while other are optional, and some should not accept argument at all.
That makes option parsing more robust.

Unfortunately retiring the old option parsing makes this change greater
than preferred.  Assuming not mistakes happen the new code works
functionally exactly as the old did.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: recommend long options with double hyphen

While the -version style options will work for next unknown number of
years start moving towards user interface that has way of invoking long
options as most of the other commands.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: use string utils to numeric parsing

Check the input numbers are numbers, which makes also the code shorter,
and user experience better as half invalid imputs will error.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: move show_tabs() and screendump() functions

Earlier the function was in the middle of option parsing code segment,
and screendump() required function prototype.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: remove usage comment segment

It is enough trouble to keep usage output aligned with getopt() parsing,
manual page, and bash-completion, so get rid of the unnecessary effort
duplication.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: add option control structure

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: add init_terminal() to make main() shorter

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: clean up screendump()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: remove devfs and /dev/vcsa0 support

The devfs files /dev/vcc/a* does not need to be supported, and vcsa0 has
not existed in years if ever.

Reference: http://lwn.net/Articles/65197/
Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devices.txt?id=14186fea0cb06bc43181ce239efe0df6f1af260a#n260
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: make -msglevel 0 to work as is did earlier

Commit 3393c136 caused regression.  The klogctl() logging range is 1-8,
but the value 0 is special according to setterm.1 manual page.  It turns
on loging, same way as '-msg on' option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: correct usage() bright color argument

This has been wrong since commit 2dc8716.  The bright is a prefix
attribute to other colors.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: improve perform_sequence() coding style

Delete pointless braces, new lines, and add spacing between operators.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: tell user when options does not effect

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: improve error messages

Reuse messages to make translation work easier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: various visual terminal effects are not console specific

Setting colors, making line not to wrap, and so on can be attempted in
other than consoles.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>