mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Use simpler logic to show progress on Linux
This commit is contained in:
parent
5f18a0892c
commit
dd02fb6049
20
src/nnn.c
20
src/nnn.c
|
@ -552,8 +552,8 @@ static const char * const envs[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
static char cp[] = "cpg -giRp";
|
static char cp[] = "cp -iRp";
|
||||||
static char mv[] = "mvg -gi";
|
static char mv[] = "mv -i";
|
||||||
#else
|
#else
|
||||||
static char cp[] = "cp -iRp";
|
static char cp[] = "cp -iRp";
|
||||||
static char mv[] = "mv -i";
|
static char mv[] = "mv -i";
|
||||||
|
@ -5897,9 +5897,6 @@ int main(int argc, char *argv[])
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
char *session = NULL;
|
char *session = NULL;
|
||||||
int opt;
|
int opt;
|
||||||
#ifdef __linux__
|
|
||||||
bool progress = FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "HSKaAb:cdeEgnop:QrRs:t:vVxh")) != -1) {
|
while ((opt = getopt(argc, argv, "HSKaAb:cdeEgnop:QrRs:t:vVxh")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
@ -5964,7 +5961,8 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
progress = TRUE;
|
cp[2] = cp[5] = mv[2] = mv[5] = 'g'; /* cp -iRp -> cpg -giRp */
|
||||||
|
cp[4] = mv[4] = '-';
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
|
@ -6136,16 +6134,6 @@ int main(int argc, char *argv[])
|
||||||
if (!set_tmp_path())
|
if (!set_tmp_path())
|
||||||
return _FAILURE;
|
return _FAILURE;
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
if (!progress) {
|
|
||||||
cp[5] = cp[4];
|
|
||||||
cp[2] = cp[4] = ' ';
|
|
||||||
|
|
||||||
mv[5] = mv[4];
|
|
||||||
mv[2] = mv[4] = ' ';
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Ignore/handle certain signals */
|
/* Ignore/handle certain signals */
|
||||||
struct sigaction act = {.sa_handler = sigint_handler};
|
struct sigaction act = {.sa_handler = sigint_handler};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue