mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
All binary confirmation is now y or Y
This commit is contained in:
parent
4db8a61dea
commit
d4b7897b41
26
src/nnn.c
26
src/nnn.c
|
@ -615,7 +615,7 @@ static char confirm_force(bool selection)
|
||||||
char str[64];
|
char str[64];
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
snprintf(str, 64, "forcibly remove %s file%s (unrecoverable)? [y/Y confirms]",
|
snprintf(str, 64, "forcibly remove %s file%s (unrecoverable)?",
|
||||||
(selection ? xitoa(nselected) : "current"), (selection ? "(s)" : ""));
|
(selection ? xitoa(nselected) : "current"), (selection ? "(s)" : ""));
|
||||||
r = get_input(str);
|
r = get_input(str);
|
||||||
|
|
||||||
|
@ -1275,11 +1275,11 @@ static void opstr(char *buf, char *op)
|
||||||
|
|
||||||
static void rmmulstr(char *buf)
|
static void rmmulstr(char *buf)
|
||||||
{
|
{
|
||||||
if (cfg.trash) {
|
if (cfg.trash)
|
||||||
snprintf(buf, CMD_LEN_MAX, "xargs -0 trash-put < %s", g_selpath);
|
snprintf(buf, CMD_LEN_MAX, "xargs -0 trash-put < %s", g_selpath);
|
||||||
} else {
|
else
|
||||||
snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c 'rm -%cr $0 $@ < /dev/tty' < %s", confirm_force(TRUE), g_selpath);
|
snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c 'rm -%cr $0 $@ < /dev/tty' < %s",
|
||||||
}
|
confirm_force(TRUE), g_selpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xrm(char *path)
|
static void xrm(char *path)
|
||||||
|
@ -1434,7 +1434,7 @@ static bool batch_rename(const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selbufpos) {
|
if (selbufpos) {
|
||||||
i = get_input("rename selection? [y/Y confirms]");
|
i = get_input("rename selection?");
|
||||||
if (i != 'y' && i != 'Y') {
|
if (i != 'y' && i != 'Y') {
|
||||||
if (!ndents)
|
if (!ndents)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -4439,9 +4439,9 @@ nochange:
|
||||||
|
|
||||||
(r == CTX_MAX - 1) ? (r = 0) : ++r;
|
(r == CTX_MAX - 1) ? (r = 0) : ++r;
|
||||||
snprintf(newpath, PATH_MAX,
|
snprintf(newpath, PATH_MAX,
|
||||||
"Create context %d? [Enter]", r + 1);
|
"Create context %d?", r + 1);
|
||||||
fd = get_input(newpath);
|
fd = get_input(newpath);
|
||||||
if (fd != '\r')
|
if (fd != 'y' && fd != 'Y')
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4807,7 +4807,7 @@ nochange:
|
||||||
|
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case SEL_ARCHIVE:
|
case SEL_ARCHIVE:
|
||||||
r = get_input("archive selection (else current)? [y/Y confirms]");
|
r = get_input("archive selection (else current)?");
|
||||||
if (r == 'y' || r == 'Y') {
|
if (r == 'y' || r == 'Y') {
|
||||||
endselection();
|
endselection();
|
||||||
|
|
||||||
|
@ -4860,7 +4860,7 @@ nochange:
|
||||||
|
|
||||||
/* Confirm if app is CLI or GUI */
|
/* Confirm if app is CLI or GUI */
|
||||||
if (sel == SEL_OPENWITH) {
|
if (sel == SEL_OPENWITH) {
|
||||||
r = get_input("cli mode? [y/Y confirms]");
|
r = get_input("cli mode?");
|
||||||
(r == 'y' || r == 'Y') ? (r = F_CLI)
|
(r == 'y' || r == 'Y') ? (r = F_CLI)
|
||||||
: (r = F_NOWAIT | F_NOTRACE | F_MULTI);
|
: (r = F_NOWAIT | F_NOTRACE | F_MULTI);
|
||||||
}
|
}
|
||||||
|
@ -4923,7 +4923,7 @@ nochange:
|
||||||
if (faccessat(fd, tmp, F_OK, AT_SYMLINK_NOFOLLOW) != -1) {
|
if (faccessat(fd, tmp, F_OK, AT_SYMLINK_NOFOLLOW) != -1) {
|
||||||
if (sel == SEL_RENAME) {
|
if (sel == SEL_RENAME) {
|
||||||
/* Overwrite file with same name? */
|
/* Overwrite file with same name? */
|
||||||
r = get_input("overwrite? [y/Y confirms]");
|
r = get_input("overwrite?");
|
||||||
if (r != 'y' && r != 'Y') {
|
if (r != 'y' && r != 'Y') {
|
||||||
close(fd);
|
close(fd);
|
||||||
break;
|
break;
|
||||||
|
@ -5171,11 +5171,11 @@ nochange:
|
||||||
} else {
|
} else {
|
||||||
for (r = 0; r < CTX_MAX; ++r)
|
for (r = 0; r < CTX_MAX; ++r)
|
||||||
if (r != cfg.curctx && g_ctx[r].c_cfg.ctxactive) {
|
if (r != cfg.curctx && g_ctx[r].c_cfg.ctxactive) {
|
||||||
r = get_input("Quit all contexts? [Enter]");
|
r = get_input("Quit all contexts?");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(r == CTX_MAX || r == '\r'))
|
if (!(r == CTX_MAX || r == 'y' || r == 'Y'))
|
||||||
break; // fallthrough
|
break; // fallthrough
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue