From 47887ac7c340639c9c6b7bf4379a1940f3e01b6c Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 18 Dec 2007 18:01:05 +0000 Subject: usage now requires a global applet var instead of a define, don't prefix describe output and use generic usage for runscript. --- src/mountinfo.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mountinfo.c') 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 #if defined(__DragonFly__) || defined(__FreeBSD__) || \ @@ -45,6 +43,7 @@ #include #include +#include #include #include #include @@ -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"); -- cgit v1.2.3