diff options
-rw-r--r-- | src/c_opts.c | 7 | ||||
-rw-r--r-- | src/c_opts.h | 4 | ||||
-rw-r--r-- | src/c_unixize.c | 8 | ||||
-rw-r--r-- | src/c_unixize.h | 1 | ||||
-rw-r--r-- | src/u_utils.c | 5 |
5 files changed, 23 insertions, 2 deletions
diff --git a/src/c_opts.c b/src/c_opts.c index fedc26a..786a16c 100644 --- a/src/c_opts.c +++ b/src/c_opts.c @@ -112,6 +112,9 @@ c_recursive_parse else if ((*ptr)[0] == 'p') { opts->pretend = TRUE; } + else if ((*ptr)[0] == 'r') { + opts->rpretend = TRUE; + } else if ((*ptr)[0] == 'R') { opts->recursive = TRUE; } @@ -144,6 +147,7 @@ c_get_opts opts->hyphen = FALSE; opts->preserve = FALSE; opts->pretend = FALSE; + opts->rpretend = FALSE; opts->recursive = FALSE; opts->verbose = FALSE; opts->cxx = 0; @@ -170,6 +174,9 @@ c_get_opts else if (opt == 'p') { opts->pretend = TRUE; } + else if (opt == 'r') { + opts->rpretend = TRUE; + } else if (opt == 'R') { opts->recursive = TRUE; } diff --git a/src/c_opts.h b/src/c_opts.h index f53d09c..a3f0cd8 100644 --- a/src/c_opts.h +++ b/src/c_opts.h @@ -48,10 +48,10 @@ #include "c_unixize.h" -#define C_OPTS "ahiknpRve:" +#define C_OPTS "ahiknprRve:" #define C_RECURSIVE_CHAR 'r' #define C_USAGE_FMT \ - "usage: unixize [-ahiknpRv] [-e version] [directory]\n" + "usage: unixize [-ahiknprRv] [-e version] [directory]\n" #define C_C_OPT_FMT \ "unixize: unsupported -e value '%s' (must be always 0, 1 or 2)\n" diff --git a/src/c_unixize.c b/src/c_unixize.c index 1866ac7..91188c9 100644 --- a/src/c_unixize.c +++ b/src/c_unixize.c @@ -150,6 +150,14 @@ main /* rename(); */ } } + else if (opts.rpretend == TRUE) { + dprintf( + STDOUT_FILENO, + "Untouched: '%s%s'\n", + subpath, + og_files->filename + ); + } og_files = og_files->next; new_files = new_files->next; } diff --git a/src/c_unixize.h b/src/c_unixize.h index 4917a66..cba4187 100644 --- a/src/c_unixize.h +++ b/src/c_unixize.h @@ -61,6 +61,7 @@ struct opts_s { bool_t hyphen; bool_t preserve; bool_t pretend; + bool_t rpretend; bool_t recursive; bool_t verbose; char dir[MAXPATHLEN]; diff --git a/src/u_utils.c b/src/u_utils.c index a2ad0a4..b5373e5 100644 --- a/src/u_utils.c +++ b/src/u_utils.c @@ -129,6 +129,11 @@ u_get_extra_args(char args[], struct opts_s* opts) null_char += 2; i++; } + if (opts->rpretend == TRUE) { + memcpy((char*)args + (i * 2), "r:", 3 * sizeof(char)); + null_char += 2; + i++; + } if (opts->verbose == TRUE) { memcpy((char*)args + (i * 2), "v:", 3 * sizeof(char)); null_char += 2; |