kill: fix coding style

The kill was deprecated at the time lot of other tools got style
unification.  Now when deprecation is lifted it is time to get kill
cleaner.  This commit does not modify code, only various spacing issues,
removal of unecessary braces, and such are dealt.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: flip all comparions to be in smaller - greater order

This makes code more readable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: move magic numbers in beginning of the file

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: make usage() not to return

And change the function argument to be an output stream.  Earlier the
--help option made kill exit with none-zero value, that is now corrected.

CC: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: deprecat invocation as 'pid' command name

Enabling options by renaming command is both unexpected and undocumented.
This magic is now deprecated and with remark of removal of this
functionality in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: use control structure to pass user input to functions

This should make it easier to understand how the program works.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: tell what is wrong rather than output usage()

Getting usage as error message is not specific enough.  As a user I want
to know what is wrong, and if it is unclear after error message how to
recover then I run command with --help.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: add parse_arguments() function

Long main() is difficult to read, so moving argument parsing to separate
function should make sense.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
kill: move sigqueue inputs to control struct

Use of global variables is messy.  The earlier implementation also
assumed queue argument never to be textual, such as 'HUP', which now
works as one might expect.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Merge branch 'kill' of git://github.com/kerolasa/lelux-utiliteetit

* 'kill' of git://github.com/kerolasa/lelux-utiliteetit:
  kill: move sigqueue inputs to control struct
  kill: add parse_arguments() function
  kill: tell what is wrong rather than output usage()
  kill: use control structure to pass user input to functions
  kill: deprecat invocation as 'pid' command name
  kill: make usage() not to return
  kill: move magic numbers in beginning of the file
  kill: flip all comparions to be in smaller - greater order
  kill: fix coding style
kill: reorder functions to make it more readable

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: rename printsignals() to print_all_signalsprint_all_signals()

Signed-off-by: Karel Zak <kzak@redhat.com>
docs: add pid alis to deprecated.txt

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: rename printsig() to print_signal_name()

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: coding style, simplify code

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: tiny change in man page

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: return 64 on partial success

Return 64 (aka SOME_OK) when more than process specified and the
operation success only for subset of the processes.

 # kill -s 0 firefox mutt xxx; echo $?
 kill: cannot find process "xxx"
 64

We already use this concept for chcpu(8) or mount(8).

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: add copyrights, etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: make kill-by-name more obvious in man page

Signed-off-by: Karel Zak <kzak@redhat.com>
kill: fix bug in --all semantic

Introduces by 2ab6683f59cd3371b1c3ac8b5c248d5104ed4d41.

Signed-off-by: Karel Zak <kzak@redhat.com>