diff options
author | Roy Marples <roy@marples.name> | 2007-12-18 18:01:05 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-18 18:01:05 +0000 |
commit | 47887ac7c340639c9c6b7bf4379a1940f3e01b6c (patch) | |
tree | c5febe0cf89b4088aa5ce3b648b153cb85752a8b /src/mountinfo.c | |
parent | 437363a3449423173bc94746a122fbf3b4cf254c (diff) |
usage now requires a global applet var instead of a define, don't prefix describe output and use generic usage for runscript.
Diffstat (limited to 'src/mountinfo.c')
-rw-r--r-- | src/mountinfo.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mountinfo.c b/src/mountinfo.c index a55bf4fd..ad76d32d 100644 --- a/src/mountinfo.c +++ b/src/mountinfo.c @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -#define APPLET "mountinfo" - #include <sys/types.h> #if defined(__DragonFly__) || defined(__FreeBSD__) || \ @@ -45,6 +43,7 @@ #include <errno.h> #include <getopt.h> +#include <libgen.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> @@ -57,6 +56,8 @@ #include "rc-misc.h" #include "strlist.h" +static const char *applet; + typedef enum { mount_from, mount_to, @@ -311,7 +312,7 @@ static regex_t *get_regex (const char *string) if ((result = regcomp (reg, string, REG_EXTENDED | REG_NOSUB)) != 0) { regerror (result, reg, buffer, sizeof (buffer)); - eerrorx ("%s: invalid regex `%s'", APPLET, buffer); + eerrorx ("%s: invalid regex `%s'", applet, buffer); } return (reg); @@ -366,6 +367,8 @@ int mountinfo (int argc, char **argv) int result; bool quiet; + applet = basename (argv[0]); + /* Ensure that we are only quiet when explicitly told to be */ unsetenv ("EINFO_QUIET"); |