2010-01-24 17:00:05 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public
|
|
|
|
* License v2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 021110-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2022-09-15 11:10:53 +00:00
|
|
|
#include "kerncompat.h"
|
2010-01-24 17:00:05 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2016-11-21 12:40:43 +00:00
|
|
|
#include <getopt.h>
|
2022-09-15 11:10:53 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <strings.h>
|
2020-08-18 13:56:04 +00:00
|
|
|
#include "kernel-shared/volumes.h"
|
2019-09-25 13:37:27 +00:00
|
|
|
#include "crypto/crc32c.h"
|
2019-06-19 23:46:21 +00:00
|
|
|
#include "common/utils.h"
|
2022-09-15 21:15:17 +00:00
|
|
|
#include "common/string-utils.h"
|
2019-06-19 23:46:21 +00:00
|
|
|
#include "common/help.h"
|
2015-06-21 16:23:19 +00:00
|
|
|
#include "common/box.h"
|
2022-09-14 15:06:52 +00:00
|
|
|
#include "cmds/commands.h"
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-08 15:45:54 +00:00
|
|
|
static const char * const btrfs_cmd_group_usage[] = {
|
2019-11-25 10:39:03 +00:00
|
|
|
"btrfs [--help] [--version] [--format <format>] [-v|--verbose] [-q|--quiet] <group> [<group>...] <command> [<args>]",
|
2012-02-08 15:45:54 +00:00
|
|
|
NULL
|
|
|
|
};
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
static const char btrfs_cmd_group_info[] =
|
|
|
|
"Use --help as an argument for information on a specific group or command.";
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
static inline const char *skip_prefix(const char *str, const char *prefix)
|
2010-01-24 17:00:05 +00:00
|
|
|
{
|
2012-02-03 19:00:17 +00:00
|
|
|
size_t len = strlen(prefix);
|
|
|
|
return strncmp(str, prefix, len) ? NULL : str + len;
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
static int parse_one_token(const char *arg, const struct cmd_group *grp,
|
|
|
|
const struct cmd_struct **cmd_ret)
|
|
|
|
{
|
|
|
|
const struct cmd_struct *abbrev_cmd = NULL, *ambiguous_cmd = NULL;
|
2018-03-07 02:07:03 +00:00
|
|
|
int i = 0;
|
2012-02-03 19:00:17 +00:00
|
|
|
|
2018-03-07 02:07:03 +00:00
|
|
|
for (i = 0; grp->commands[i]; i++) {
|
|
|
|
const struct cmd_struct *cmd = grp->commands[i];
|
2012-02-03 19:00:17 +00:00
|
|
|
const char *rest;
|
|
|
|
|
|
|
|
rest = skip_prefix(arg, cmd->token);
|
|
|
|
if (!rest) {
|
|
|
|
if (!prefixcmp(cmd->token, arg)) {
|
|
|
|
if (abbrev_cmd) {
|
|
|
|
/*
|
|
|
|
* If this is abbreviated, it is
|
|
|
|
* ambiguous. So when there is no
|
|
|
|
* exact match later, we need to
|
|
|
|
* error out.
|
|
|
|
*/
|
|
|
|
ambiguous_cmd = abbrev_cmd;
|
|
|
|
}
|
|
|
|
abbrev_cmd = cmd;
|
|
|
|
}
|
|
|
|
continue;
|
2011-01-23 12:42:43 +00:00
|
|
|
}
|
2012-02-03 19:00:17 +00:00
|
|
|
if (*rest)
|
|
|
|
continue;
|
2011-01-23 12:42:43 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
*cmd_ret = cmd;
|
|
|
|
return 0;
|
|
|
|
}
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
if (ambiguous_cmd)
|
|
|
|
return -2;
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
if (abbrev_cmd) {
|
|
|
|
*cmd_ret = abbrev_cmd;
|
|
|
|
return 0;
|
|
|
|
}
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
return -1;
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
static const struct cmd_struct *
|
|
|
|
parse_command_token(const char *arg, const struct cmd_group *grp)
|
2010-01-24 17:00:05 +00:00
|
|
|
{
|
2012-08-10 02:46:16 +00:00
|
|
|
const struct cmd_struct *cmd = NULL;
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
switch(parse_one_token(arg, grp, &cmd)) {
|
|
|
|
case -1:
|
|
|
|
help_unknown_token(arg, grp);
|
|
|
|
case -2:
|
|
|
|
help_ambiguous_token(arg, grp);
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
return cmd;
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
2018-03-06 02:29:30 +00:00
|
|
|
static void check_output_format(const struct cmd_struct *cmd)
|
|
|
|
{
|
|
|
|
if (cmd->next)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!(cmd->flags & bconf.output_format & CMD_FORMAT_MASK)) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"ERROR: output format %s is unsupported for this command\n",
|
|
|
|
output_format_name(bconf.output_format));
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:20:47 +00:00
|
|
|
static void handle_help_options_next_level(const struct cmd_struct *cmd,
|
|
|
|
int argc, char **argv)
|
2012-02-03 19:00:17 +00:00
|
|
|
{
|
|
|
|
if (argc < 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!strcmp(argv[1], "--help")) {
|
|
|
|
if (cmd->next) {
|
|
|
|
argc--;
|
|
|
|
argv++;
|
|
|
|
help_command_group(cmd->next, argc, argv);
|
|
|
|
} else {
|
2018-03-05 21:49:00 +00:00
|
|
|
usage_command(cmd, true, false);
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
2012-02-03 19:00:17 +00:00
|
|
|
|
|
|
|
exit(0);
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-07 04:27:53 +00:00
|
|
|
int handle_command_group(const struct cmd_struct *cmd, int argc,
|
2012-02-03 19:00:17 +00:00
|
|
|
char **argv)
|
|
|
|
{
|
2018-03-07 04:27:53 +00:00
|
|
|
const struct cmd_struct *subcmd;
|
2010-03-11 20:08:22 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
argc--;
|
|
|
|
argv++;
|
|
|
|
if (argc < 1) {
|
2018-03-07 04:27:53 +00:00
|
|
|
usage_command_group(cmd->next, false, false);
|
2012-02-03 19:00:17 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2010-03-11 20:08:22 +00:00
|
|
|
|
2018-03-07 04:27:53 +00:00
|
|
|
subcmd = parse_command_token(argv[0], cmd->next);
|
2012-02-03 19:00:17 +00:00
|
|
|
|
2018-03-07 04:27:53 +00:00
|
|
|
handle_help_options_next_level(subcmd, argc, argv);
|
2018-03-06 02:29:30 +00:00
|
|
|
check_output_format(subcmd);
|
2012-02-03 19:00:17 +00:00
|
|
|
|
2018-03-07 04:27:53 +00:00
|
|
|
fixup_argv0(argv, subcmd->token);
|
|
|
|
return cmd_execute(subcmd, argc, argv);
|
2010-03-11 20:08:22 +00:00
|
|
|
}
|
|
|
|
|
2013-08-14 23:16:41 +00:00
|
|
|
static const struct cmd_group btrfs_cmd_group;
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
static const char * const cmd_help_usage[] = {
|
2015-06-21 16:23:19 +00:00
|
|
|
"btrfs help [--full] [--box]",
|
2013-07-23 02:43:21 +00:00
|
|
|
"Display help information",
|
2012-02-03 19:00:17 +00:00
|
|
|
"",
|
|
|
|
"--full display detailed help on every command",
|
2015-06-21 16:23:19 +00:00
|
|
|
"--box show list of built-in tools (busybox style)",
|
2012-02-03 19:00:17 +00:00
|
|
|
NULL
|
|
|
|
};
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2018-03-07 02:24:46 +00:00
|
|
|
static int cmd_help(const struct cmd_struct *unused, int argc, char **argv)
|
2012-02-03 19:00:17 +00:00
|
|
|
{
|
2015-06-21 16:23:19 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
|
if (strcmp(argv[i], "--box") == 0) {
|
|
|
|
#if ENABLE_BOX
|
|
|
|
printf("Standalone tools built-in in the busybox style:\n");
|
|
|
|
printf("- mkfs.btrfs\n");
|
|
|
|
printf("- btrfs-image\n");
|
|
|
|
printf("- btrfs-convert\n");
|
|
|
|
printf("- btrfstune\n");
|
|
|
|
printf("- btrfs-find-root\n");
|
|
|
|
#else
|
|
|
|
printf("No standalone tools built-in in the busybox style\n");
|
|
|
|
#endif
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
2012-02-03 19:00:17 +00:00
|
|
|
help_command_group(&btrfs_cmd_group, argc, argv);
|
|
|
|
return 0;
|
|
|
|
}
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2018-03-07 02:07:03 +00:00
|
|
|
static DEFINE_SIMPLE_COMMAND(help, "help");
|
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
static const char * const cmd_version_usage[] = {
|
|
|
|
"btrfs version",
|
|
|
|
"Display btrfs-progs version",
|
|
|
|
NULL
|
|
|
|
};
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2018-03-07 02:24:46 +00:00
|
|
|
static int cmd_version(const struct cmd_struct *unused, int argc, char **argv)
|
2012-02-03 19:00:17 +00:00
|
|
|
{
|
2014-12-09 14:37:03 +00:00
|
|
|
printf("%s\n", PACKAGE_STRING);
|
2012-02-03 19:00:17 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2018-03-07 02:07:03 +00:00
|
|
|
static DEFINE_SIMPLE_COMMAND(version, "version");
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2018-03-06 02:29:30 +00:00
|
|
|
static void print_output_formats(FILE *outf)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
fputs("Options for --format are:", outf);
|
|
|
|
for (i = 0; i < ARRAY_SIZE(output_formats); i++)
|
|
|
|
fprintf(outf, "%s%s", i ? ", " : " ", output_formats[i].name);
|
|
|
|
fputs("\n", outf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void handle_output_format(const char *format)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
bool found = false;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(output_formats); i++) {
|
|
|
|
if (!strcasecmp(format, output_formats[i].name)) {
|
|
|
|
bconf.output_format = output_formats[i].value;
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Print error for invalid format */
|
|
|
|
if (!found) {
|
|
|
|
bconf.output_format = CMD_FORMAT_TEXT;
|
|
|
|
fprintf(stderr, "error: invalid output format \"%s\"\n\n",
|
|
|
|
format);
|
|
|
|
print_output_formats(stderr);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-21 12:40:43 +00:00
|
|
|
/*
|
|
|
|
* Parse global options, between binary name and first non-option argument
|
|
|
|
* after processing all valid options (including those with arguments).
|
|
|
|
*
|
2018-11-26 17:01:42 +00:00
|
|
|
* Returns index to argv where parsing stopped, optind is reset to 1
|
2016-11-21 12:40:43 +00:00
|
|
|
*/
|
|
|
|
static int handle_global_options(int argc, char **argv)
|
2012-02-03 19:00:17 +00:00
|
|
|
{
|
2018-03-06 02:29:30 +00:00
|
|
|
enum { OPT_HELP = 256, OPT_VERSION, OPT_FULL, OPT_FORMAT };
|
2016-11-21 12:40:43 +00:00
|
|
|
static const struct option long_options[] = {
|
|
|
|
{ "help", no_argument, NULL, OPT_HELP },
|
|
|
|
{ "version", no_argument, NULL, OPT_VERSION },
|
2018-03-06 02:29:30 +00:00
|
|
|
{ "format", required_argument, NULL, OPT_FORMAT },
|
2016-11-21 12:40:43 +00:00
|
|
|
{ "full", no_argument, NULL, OPT_FULL },
|
2019-11-25 10:39:03 +00:00
|
|
|
{ "verbose", no_argument, NULL, 'v' },
|
|
|
|
{ "quiet", no_argument, NULL, 'q' },
|
2016-11-21 12:40:43 +00:00
|
|
|
{ NULL, 0, NULL, 0}
|
|
|
|
};
|
|
|
|
int shift;
|
2015-10-29 09:31:48 +00:00
|
|
|
|
|
|
|
if (argc == 0)
|
2016-11-21 12:40:43 +00:00
|
|
|
return 0;
|
2015-10-29 09:31:48 +00:00
|
|
|
|
2016-11-21 12:40:43 +00:00
|
|
|
opterr = 0;
|
|
|
|
while (1) {
|
|
|
|
int c;
|
|
|
|
|
2019-11-25 10:39:03 +00:00
|
|
|
c = getopt_long(argc, argv, "+vq", long_options, NULL);
|
2016-11-21 12:40:43 +00:00
|
|
|
if (c < 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
switch (c) {
|
|
|
|
case OPT_HELP: break;
|
|
|
|
case OPT_VERSION: break;
|
|
|
|
case OPT_FULL: break;
|
2018-03-06 02:29:30 +00:00
|
|
|
case OPT_FORMAT:
|
|
|
|
handle_output_format(optarg);
|
|
|
|
break;
|
2019-11-25 10:39:03 +00:00
|
|
|
case 'v':
|
|
|
|
bconf_be_verbose();
|
|
|
|
break;
|
|
|
|
case 'q':
|
|
|
|
bconf_be_quiet();
|
|
|
|
break;
|
2016-11-21 12:40:43 +00:00
|
|
|
default:
|
|
|
|
fprintf(stderr, "Unknown global option: %s\n",
|
|
|
|
argv[optind - 1]);
|
|
|
|
exit(129);
|
|
|
|
}
|
|
|
|
}
|
2015-10-29 09:31:48 +00:00
|
|
|
|
2016-11-21 12:40:43 +00:00
|
|
|
shift = optind;
|
|
|
|
optind = 1;
|
|
|
|
|
|
|
|
return shift;
|
|
|
|
}
|
|
|
|
|
2018-11-05 19:06:43 +00:00
|
|
|
static void handle_special_globals(int shift, int argc, char **argv)
|
2016-11-21 12:40:43 +00:00
|
|
|
{
|
2018-03-05 21:49:00 +00:00
|
|
|
bool has_help = false;
|
|
|
|
bool has_full = false;
|
2016-11-21 12:40:43 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < shift; i++) {
|
|
|
|
if (strcmp(argv[i], "--help") == 0)
|
2018-03-05 21:49:00 +00:00
|
|
|
has_help = true;
|
2016-11-21 12:40:43 +00:00
|
|
|
else if (strcmp(argv[i], "--full") == 0)
|
2018-03-05 21:49:00 +00:00
|
|
|
has_full = true;
|
2016-11-21 12:40:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (has_help) {
|
|
|
|
if (has_full)
|
2018-03-05 21:49:00 +00:00
|
|
|
usage_command_group(&btrfs_cmd_group, true, false);
|
2016-11-21 12:40:43 +00:00
|
|
|
else
|
2018-03-07 02:24:46 +00:00
|
|
|
cmd_execute(&cmd_struct_help, argc, argv);
|
2018-03-06 02:29:30 +00:00
|
|
|
print_output_formats(stdout);
|
2016-11-21 12:40:43 +00:00
|
|
|
exit(0);
|
|
|
|
}
|
2015-10-29 09:31:48 +00:00
|
|
|
|
2016-11-21 12:40:43 +00:00
|
|
|
for (i = 0; i < shift; i++)
|
|
|
|
if (strcmp(argv[i], "--version") == 0) {
|
2018-03-07 02:24:46 +00:00
|
|
|
cmd_execute(&cmd_struct_version, argc, argv);
|
2016-11-21 12:40:43 +00:00
|
|
|
exit(0);
|
|
|
|
}
|
2019-11-25 10:39:03 +00:00
|
|
|
|
|
|
|
for (i = 0; i < shift; i++)
|
|
|
|
if (strcmp(argv[i], "--verbose") == 0)
|
|
|
|
bconf_be_verbose();
|
|
|
|
|
|
|
|
for (i = 0; i < shift; i++)
|
|
|
|
if (strcmp(argv[i], "--quiet") == 0)
|
|
|
|
bconf_be_quiet();
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
2013-08-14 23:16:41 +00:00
|
|
|
static const struct cmd_group btrfs_cmd_group = {
|
2012-02-03 19:00:17 +00:00
|
|
|
btrfs_cmd_group_usage, btrfs_cmd_group_info, {
|
2020-10-31 00:15:20 +00:00
|
|
|
/* Keep subcommands alphabetically sorted */
|
2018-03-07 02:07:03 +00:00
|
|
|
&cmd_struct_balance,
|
|
|
|
&cmd_struct_check,
|
2020-10-31 00:15:20 +00:00
|
|
|
&cmd_struct_device,
|
|
|
|
&cmd_struct_filesystem,
|
2018-03-07 02:07:03 +00:00
|
|
|
&cmd_struct_inspect,
|
|
|
|
&cmd_struct_property,
|
|
|
|
&cmd_struct_qgroup,
|
2020-10-31 00:15:20 +00:00
|
|
|
&cmd_struct_quota,
|
|
|
|
&cmd_struct_receive,
|
2018-03-07 02:07:03 +00:00
|
|
|
&cmd_struct_replace,
|
2020-10-31 00:15:20 +00:00
|
|
|
&cmd_struct_rescue,
|
|
|
|
&cmd_struct_restore,
|
|
|
|
&cmd_struct_scrub,
|
|
|
|
&cmd_struct_send,
|
|
|
|
&cmd_struct_subvolume,
|
|
|
|
|
|
|
|
/* Help and version stay last */
|
2018-03-07 02:07:03 +00:00
|
|
|
&cmd_struct_help,
|
|
|
|
&cmd_struct_version,
|
|
|
|
NULL
|
2012-02-03 19:00:17 +00:00
|
|
|
},
|
|
|
|
};
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
const struct cmd_struct *cmd;
|
2013-02-12 19:24:50 +00:00
|
|
|
const char *bname;
|
2015-10-26 10:28:18 +00:00
|
|
|
int ret;
|
2012-02-03 19:00:17 +00:00
|
|
|
|
2016-11-21 12:52:01 +00:00
|
|
|
btrfs_config_init();
|
|
|
|
|
2013-02-12 19:24:50 +00:00
|
|
|
if ((bname = strrchr(argv[0], '/')) != NULL)
|
|
|
|
bname++;
|
|
|
|
else
|
|
|
|
bname = argv[0];
|
|
|
|
|
|
|
|
if (!strcmp(bname, "btrfsck")) {
|
|
|
|
argv[0] = "check";
|
2015-06-21 16:23:19 +00:00
|
|
|
#ifdef ENABLE_BOX
|
|
|
|
} else if (!strcmp(bname, "mkfs.btrfs")) {
|
|
|
|
return mkfs_main(argc, argv);
|
|
|
|
} else if (!strcmp(bname, "btrfs-image")) {
|
|
|
|
return image_main(argc, argv);
|
|
|
|
} else if (!strcmp(bname, "btrfs-convert")) {
|
|
|
|
return convert_main(argc, argv);
|
|
|
|
} else if (!strcmp(bname, "btrfstune")) {
|
|
|
|
return btrfstune_main(argc, argv);
|
|
|
|
#endif
|
2012-02-03 19:00:17 +00:00
|
|
|
} else {
|
2016-11-21 12:40:43 +00:00
|
|
|
int shift;
|
|
|
|
|
|
|
|
shift = handle_global_options(argc, argv);
|
|
|
|
handle_special_globals(shift, argc, argv);
|
|
|
|
while (shift-- > 0) {
|
|
|
|
argc--;
|
|
|
|
argv++;
|
|
|
|
}
|
|
|
|
if (argc == 0) {
|
2015-06-08 16:54:04 +00:00
|
|
|
usage_command_group_short(&btrfs_cmd_group);
|
2013-02-12 19:24:50 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2010-01-24 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
cmd = parse_command_token(argv[0], &btrfs_cmd_group);
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
handle_help_options_next_level(cmd, argc, argv);
|
2010-01-24 17:00:05 +00:00
|
|
|
|
2013-02-12 19:24:50 +00:00
|
|
|
crc32c_optimization_init();
|
|
|
|
|
2012-02-03 19:00:17 +00:00
|
|
|
fixup_argv0(argv, cmd->token);
|
2015-10-26 10:28:18 +00:00
|
|
|
|
2018-03-07 02:07:03 +00:00
|
|
|
ret = cmd_execute(cmd, argc, argv);
|
2015-10-26 10:28:18 +00:00
|
|
|
|
|
|
|
btrfs_close_all_devices();
|
|
|
|
|
|
|
|
exit(ret);
|
2012-02-03 19:00:17 +00:00
|
|
|
}
|