--- /dev/null
+#ifndef UTIL_LINUX_OPTUTILS_H
+#define UTIL_LINUX_OPTUTILS_H
+
+static inline const char *option_to_longopt(int c, const struct option *opts)
+{
+ const struct option *o;
+
+ for (o = opts; o->name; o++)
+ if (o->val == c)
+ return o->name;
+ return NULL;
+}
+
+#endif
+
#include "nls.h"
#include "c.h"
#include "env.h"
+#include "optutils.h"
/*** TODO: DOCS:
*
mnt_get_library_version(&ver);
- printf("%s from %s (libmount %s)\n",
+ printf(_("%s from %s (libmount %s)\n"),
program_invocation_short_name, PACKAGE_STRING, ver);
exit(EX_SUCCESS);
}
return 0;
}
-static const char *opt_to_longopt(int c, const struct option *opts)
-{
- const struct option *o;
-
- for (o = opts; o->name; o++)
- if (o->val == c)
- return o->name;
- return NULL;
-}
-
static void print_all(struct libmnt_context *cxt, char *pattern, int show_label)
{
struct libmnt_table *tb;
/* only few options are allowed for non-root users */
if (mnt_context_is_restricted(cxt) && !strchr("hlLUVv", c))
- exit_non_root(opt_to_longopt(c, longopts));
+ exit_non_root(option_to_longopt(c, longopts));
switch(c) {
case 'a':