summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-01-25 14:26:38 +0000
committerJim Meyering <jim@meyering.net>1999-01-25 14:26:38 +0000
commita4c1c9627e5922c52c3119cda71c55312d3af455 (patch)
treebef5876f9e8f6a58c8152ca976664af84ba037d7 /src
parent53ab150d29f10e970e7e080f4e82bb82433df37d (diff)
downloadcoreutils-a4c1c9627e5922c52c3119cda71c55312d3af455.tar.xz
(usage): Remove static attribute.
Move function be the first in the file.
Diffstat (limited to 'src')
-rw-r--r--src/env.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/src/env.c b/src/env.c
index 668de6148..8f677359c 100644
--- a/src/env.c
+++ b/src/env.c
@@ -1,5 +1,5 @@
/* env - run a program in a modified environment
- Copyright (C) 86,91,92,93,94,95,96,1997 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1991-1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -88,8 +88,6 @@
int putenv ();
-static void usage PARAMS ((int status));
-
extern char **environ;
/* The name by which this program was run. */
@@ -110,6 +108,32 @@ static struct option const longopts[] =
{NULL, 0, NULL, 0}
};
+void
+usage (int status)
+{
+ if (status != 0)
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
+ program_name);
+ else
+ {
+ printf (_("\
+Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n"),
+ program_name);
+ printf (_("\
+Set each NAME to VALUE in the environment and run COMMAND.\n\
+\n\
+ -i, --ignore-environment start with an empty environment\n\
+ -u, --unset=NAME remove variable from the environment\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+\n\
+A mere - implies -i. If no COMMAND, print the resulting environment.\n\
+"));
+ puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
+ }
+ exit (status);
+}
+
int
main (register int argc, register char **argv, char **envp)
{
@@ -179,29 +203,3 @@ main (register int argc, register char **argv, char **envp)
execvp (argv[optind], &argv[optind]);
error (errno == ENOENT ? 127 : 126, errno, "%s", argv[optind]);
}
-
-static void
-usage (int status)
-{
- if (status != 0)
- fprintf (stderr, _("Try `%s --help' for more information.\n"),
- program_name);
- else
- {
- printf (_("\
-Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n"),
- program_name);
- printf (_("\
-Set each NAME to VALUE in the environment and run COMMAND.\n\
-\n\
- -i, --ignore-environment start with an empty environment\n\
- -u, --unset=NAME remove variable from the environment\n\
- --help display this help and exit\n\
- --version output version information and exit\n\
-\n\
-A mere - implies -i. If no COMMAND, print the resulting environment.\n\
-"));
- puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
- }
- exit (status);
-}