aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_opts.c
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-06 01:28:25 +0000
committerjozan <jozan@noemail.net>2020-11-06 01:28:25 +0000
commit4c62287110a7b81769d6999950b4a27a3d0cc046 (patch)
tree3b7b6729c3f019a269e7224a3b9b68cd941bde94 /src/c_opts.c
parentLooks like I have to code well (diff)
downloadunixize-4c62287110a7b81769d6999950b4a27a3d0cc046.tar.gz
unixize-4c62287110a7b81769d6999950b4a27a3d0cc046.tar.bz2
unixize-4c62287110a7b81769d6999950b4a27a3d0cc046.tar.xz
unixize-4c62287110a7b81769d6999950b4a27a3d0cc046.tar.zst
unixize-4c62287110a7b81769d6999950b4a27a3d0cc046.zip
Recursion in progress
FossilOrigin-Name: 9acb0381b558565524c28866313ef303bca12cadc7def46d3a0efef91ffb8a81
Diffstat (limited to '')
-rw-r--r--src/c_opts.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/c_opts.c b/src/c_opts.c
index 6b163c7..c4efa73 100644
--- a/src/c_opts.c
+++ b/src/c_opts.c
@@ -88,14 +88,13 @@ c_get_opts
const char* argv[])
{
int opt;
- bool_t confirm;
- opts->recursive = FALSE;
- opts->verbose = FALSE;
- opts->pretend = FALSE;
+ opts->confirm = FALSE;
opts->hidden = FALSE;
opts->hyphen = FALSE;
- confirm = FALSE;
+ opts->pretend = FALSE;
+ opts->recursive = FALSE;
+ opts->verbose = FALSE;
while ((opt = getopt(argc, (char *const *)argv, C_OPTS)) != -1) {
if (opt == 'a') {
opts->hidden = TRUE;
@@ -105,7 +104,7 @@ c_get_opts
exit(0);
}
else if (opt == 'i') {
- confirm = TRUE;
+ opts->confirm = TRUE;
}
else if (opt == 'n') {
opts->hyphen = TRUE;
@@ -133,7 +132,7 @@ c_get_opts
else if (argv[optind] == NULL) {
strncpy(opts->dir, ".", 2 * sizeof(char));
}
- if (confirm == TRUE) {
+ if (opts->confirm == TRUE) {
c_ask_confirm(opts->dir);
}
if (opts->pretend == TRUE) {