diff options
Diffstat (limited to 'btrfs-image.c')
-rw-r--r-- | btrfs-image.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/btrfs-image.c b/btrfs-image.c index af5437b4..953d368d 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@ -2716,17 +2716,17 @@ out: static void print_usage(int ret) { - fprintf(stderr, "usage: btrfs-image [options] source target\n"); - fprintf(stderr, "\t-r \trestore metadump image\n"); - fprintf(stderr, "\t-c value\tcompression level (0 ~ 9)\n"); - fprintf(stderr, "\t-t value\tnumber of threads (1 ~ 32)\n"); - fprintf(stderr, "\t-o \tdon't mess with the chunk tree when restoring\n"); - fprintf(stderr, "\t-s \tsanitize file names, use once to just use garbage, use twice if you want crc collisions\n"); - fprintf(stderr, "\t-w \twalk all trees instead of using extent tree, do this if your extent tree is broken\n"); - fprintf(stderr, "\t-m \trestore for multiple devices\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "\tIn the dump mode, source is the btrfs device and target is the output file (use '-' for stdout).\n"); - fprintf(stderr, "\tIn the restore mode, source is the dumped image and target is the btrfs device/file.\n"); + printf("usage: btrfs-image [options] source target\n"); + printf("\t-r \trestore metadump image\n"); + printf("\t-c value\tcompression level (0 ~ 9)\n"); + printf("\t-t value\tnumber of threads (1 ~ 32)\n"); + printf("\t-o \tdon't mess with the chunk tree when restoring\n"); + printf("\t-s \tsanitize file names, use once to just use garbage, use twice if you want crc collisions\n"); + printf("\t-w \twalk all trees instead of using extent tree, do this if your extent tree is broken\n"); + printf("\t-m \trestore for multiple devices\n"); + printf("\n"); + printf("\tIn the dump mode, source is the btrfs device and target is the output file (use '-' for stdout).\n"); + printf("\tIn the restore mode, source is the dumped image and target is the btrfs device/file.\n"); exit(ret); } @@ -2760,13 +2760,19 @@ int main(int argc, char *argv[]) break; case 't': num_threads = arg_strtou64(optarg); - if (num_threads > 32) - print_usage(1); + if (num_threads > 32) { + error("number of threads out of range: %llu", + (unsigned long long)num_threads); + return 1; + } break; case 'c': compress_level = arg_strtou64(optarg); - if (compress_level > 9) - print_usage(1); + if (compress_level > 9) { + error("compression level out of range: %llu", + (unsigned long long)compress_level); + return 1; + } break; case 'o': old_restore = 1; |