sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 575b38391c9e329645559ed245456e46ba6a41c6
parent f4885477798bae97ed112ebd6a4b4a0ed8e61be1
Author: dwts <mr.dwts@gmail.com>
Date:   Tue Apr 22 15:13:51 +0300

keep usage definition above main

Diffstat:
chroot.c | 11+++++------
nice.c | 11+++++------
renice.c | 12++++++------
split.c | 13++++++-------
4 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/chroot.c b/chroot.c @@ -4,7 +4,11 @@ #include <unistd.h> #include "util.h" -static void usage(void); +static void +usage(void) +{ + eprintf("usage: chroot dir [command [arg...]]\n"); +} int main(int argc, char *argv[]) @@ -43,8 +47,3 @@ main(int argc, char *argv[]) return EXIT_FAILURE; } -void -usage(void) -{ - eprintf("usage: chroot dir [command [arg...]]\n"); -} diff --git a/nice.c b/nice.c @@ -8,7 +8,11 @@ #include <unistd.h> #include "util.h" -static void usage(void); +static void +usage(void) +{ + eprintf("usage: nice [-n inc] command [options ...]\n"); +} int main(int argc, char *argv[]) @@ -43,8 +47,3 @@ main(int argc, char *argv[]) return (savederrno == ENOENT)? 127 : 126; } -static void -usage(void) -{ - eprintf("usage: nice [-n inc] command [options ...]\n"); -} diff --git a/renice.c b/renice.c @@ -11,7 +11,12 @@ static int strtop(const char *); static bool renice(int, int, long); -static void usage(void); + +static void +usage(void) +{ + eprintf("renice -n inc [-g | -p | -u] ID ...\n"); +} int main(int argc, char *argv[]) @@ -110,8 +115,3 @@ renice(int which, int who, long adj) return true; } -static void -usage(void) -{ - eprintf("renice -n inc [-g | -p | -u] ID ...\n"); -} diff --git a/split.c b/split.c @@ -9,7 +9,12 @@ static int itostr(char *, int, int); static FILE *nextfile(FILE *, char *, int, int); -static void usage(void); + +static void +usage(void) +{ + eprintf("usage: split [-d] [-a len] [-b [bytes[k|m|g]]] [-l [lines]] [input [prefix]]\n"); +} static int base = 26, start = 'a'; @@ -103,12 +108,6 @@ Nextfile: return EXIT_SUCCESS; } -void -usage(void) -{ - eprintf("usage: split [-d] [-a len] [-b [bytes[k|m|g]]] [-l [lines]] [input [prefix]]\n"); -} - int itostr(char *str, int x, int n) {