mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Use force only in case of rm
This commit is contained in:
parent
efe445910f
commit
8eb4cd9e9f
16
src/nnn.c
16
src/nnn.c
|
@ -3155,24 +3155,22 @@ nochange:
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
|
||||||
char force = confirm_force();
|
|
||||||
|
|
||||||
if (sel == SEL_CP) {
|
if (sel == SEL_CP) {
|
||||||
snprintf(g_buf, CMD_LEN_MAX,
|
snprintf(g_buf, CMD_LEN_MAX,
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
"xargs -0 -a %s -%c src cp -%cRp src .",
|
"xargs -0 -a %s -%c src cp -iRp src .",
|
||||||
#else
|
#else
|
||||||
"cat %s | xargs -0 -o -%c src cp -%cRp src .",
|
"cat %s | xargs -0 -o -%c src cp -iRp src .",
|
||||||
#endif
|
#endif
|
||||||
g_cppath, REPLACE_STR, force);
|
g_cppath, REPLACE_STR);
|
||||||
} else if (sel == SEL_MV) {
|
} else if (sel == SEL_MV) {
|
||||||
snprintf(g_buf, CMD_LEN_MAX,
|
snprintf(g_buf, CMD_LEN_MAX,
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
"xargs -0 -a %s -%c src mv -%c src .",
|
"xargs -0 -a %s -%c src mv -i src .",
|
||||||
#else
|
#else
|
||||||
"cat %s | xargs -0 -o -%c src mv -%c src .",
|
"cat %s | xargs -0 -o -%c src mv -i src .",
|
||||||
#endif
|
#endif
|
||||||
g_cppath, REPLACE_STR, force);
|
g_cppath, REPLACE_STR);
|
||||||
} else { /* SEL_RMMUL */
|
} else { /* SEL_RMMUL */
|
||||||
snprintf(g_buf, CMD_LEN_MAX,
|
snprintf(g_buf, CMD_LEN_MAX,
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
@ -3180,7 +3178,7 @@ nochange:
|
||||||
#else
|
#else
|
||||||
"cat %s | xargs -0 -o rm -%cr",
|
"cat %s | xargs -0 -o rm -%cr",
|
||||||
#endif
|
#endif
|
||||||
g_cppath, force);
|
g_cppath, confirm_force());
|
||||||
}
|
}
|
||||||
|
|
||||||
spawn("sh", "-c", g_buf, path, F_NORMAL | F_SIGINT);
|
spawn("sh", "-c", g_buf, path, F_NORMAL | F_SIGINT);
|
||||||
|
|
Loading…
Reference in a new issue