]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Enable -r, --recursive option.
authorJia Tan <jiat0218@gmail.com>
Sat, 21 Oct 2023 14:55:51 +0000 (22:55 +0800)
committerJia Tan <jiat0218@gmail.com>
Mon, 29 Jan 2024 13:40:53 +0000 (21:40 +0800)
src/xz/args.c
src/xz/args.h

index 4dadda2a2a9b3dcb7ad2aa560e7ccd09e94c9b0a..05e9c94c7b0c5b5c3b8eb998bc093989b4dccd52 100644 (file)
@@ -24,6 +24,7 @@ bool opt_force = false;
 bool opt_keep_original = false;
 bool opt_robot = false;
 bool opt_ignore_check = false;
+bool opt_recursive = false;
 
 // We don't modify or free() this, but we need to assign it in some
 // non-const pointers.
@@ -230,7 +231,7 @@ parse_real(args_info *args, int argc, char **argv)
                { "single-stream", no_argument,      NULL,  OPT_SINGLE_STREAM },
                { "no-sparse",    no_argument,       NULL,  OPT_NO_SPARSE },
                { "suffix",       required_argument, NULL,  'S' },
-               // { "recursive",      no_argument,       NULL,  'r' }, // TODO
+               { "recursive",      no_argument,       NULL,  'r' },
                { "files",        optional_argument, NULL,  OPT_FILES },
                { "files0",       optional_argument, NULL,  OPT_FILES0 },
 
@@ -334,6 +335,11 @@ parse_real(args_info *args, int argc, char **argv)
                        suffix_set(optarg);
                        break;
 
+               // --recursive
+               case 'r':
+                       opt_recursive = true;
+                       break;
+
                case 'T': {
                        // Since xz 5.4.0: Ignore leading '+' first.
                        const char *s = optarg;
index a1f42f8a92ee609259c83f7b681b293230e419dd..fff04353effe860b7f1faf35bf1dfad4dace9580 100644 (file)
@@ -35,7 +35,7 @@ typedef struct {
 extern bool opt_stdout;
 extern bool opt_force;
 extern bool opt_keep_original;
-// extern bool opt_recursive;
+extern bool opt_recursive;
 extern bool opt_robot;
 extern bool opt_ignore_check;