#include "commands.h"
#include "utils.h"
-static char argv0_buf[ARGV0_BUF_SIZE];
-
#define USAGE_SHORT 1U
#define USAGE_LONG 2U
#define USAGE_OPTIONS 4U
void help_unknown_token(const char *arg, const struct cmd_group *grp)
{
- fprintf(stderr, "%s: unknown token '%s'\n", argv0_buf, arg);
+ fprintf(stderr, "%s: unknown token '%s'\n", get_argv0_buf(), arg);
usage_command_group(grp, 0, 1);
exit(1);
}
{
const struct cmd_struct *cmd = grp->commands;
- fprintf(stderr, "%s: ambiguous token '%s'\n", argv0_buf, arg);
+ fprintf(stderr, "%s: ambiguous token '%s'\n", get_argv0_buf(), arg);
fprintf(stderr, "\nDid you mean one of these ?\n");
for (; cmd->token; cmd++) {
static char argv0_buf[ARGV0_BUF_SIZE] = "btrfs";
+const char *get_argv0_buf(void)
+{
+ return argv0_buf;
+}
+
void fixup_argv0(char **argv, const char *token)
{
int len = strlen(argv0_buf);
int btrfs_tree_search2_ioctl_supported(int fd);
int btrfs_check_nodesize(u32 nodesize, u32 sectorsize);
+const char *get_argv0_buf(void);
+
#endif