keep usage definition above main

This commit is contained in:
dwts 2014-04-22 15:13:51 +03:00 committed by sin
parent f488547779
commit 575b38391c
4 changed files with 22 additions and 25 deletions

View File

@ -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");
}

11
nice.c
View File

@ -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");
}

View File

@ -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");
}

13
split.c
View File

@ -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)
{