complete -c nnn -s a -d 'auto-create NNN_FIFO'
complete -c nnn -s A -d 'disable dir auto-enter'
complete -c nnn -s b -r -d 'bookmark key to open' -x -a '(echo $NNN_BMS | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
+complete -c nnn -s B -d 'use bsdtar for archives'
complete -c nnn -s c -d 'cli-only opener'
complete -c nnn -s C -d 'color by context'
complete -c nnn -s d -d 'start in detail mode'
'(-a)-a[auto-create NNN_FIFO]'
'(-A)-A[disable dir auto-enter]'
'(-b)-b[bookmark key to open]:key char'
+ '(-B)-B[use bsdtar for archives]'
'(-c)-c[cli-only opener]'
'(-C)-C[color by context]'
'(-d)-d[start in detail mode]'
uint_t stayonsel : 1; /* Disable auto-advance on selection */
uint_t trash : 2; /* Trash method 0: rm -rf, 1: trash-cli, 2: gio trash */
uint_t uidgid : 1; /* Show owner and group info */
- uint_t reserved : 6; /* Adjust when adding/removing a field */
+ uint_t usebsdtar : 1; /* Use bsdtar as default archive utility */
+ uint_t reserved : 5; /* Adjust when adding/removing a field */
} runstate;
/* Contexts or workspaces */
{
uchar_t i = 3;
- if (getutil(utils[UTIL_ATOOL]))
+ if (!g_state.usebsdtar && getutil(utils[UTIL_ATOOL]))
i = 0;
else if (getutil(utils[UTIL_BSDTAR]))
i = 1;
char arg[] = "-tvf"; /* options for tar/bsdtar to list files */
char *util, *outdir = NULL;
bool x_to = FALSE;
- bool is_atool = getutil(utils[UTIL_ATOOL]);
+ bool is_atool = (!g_state.usebsdtar && getutil(utils[UTIL_ATOOL]));
if (op == 'x') {
outdir = xreadline(is_atool ? "." : xbasename(fpath), messages[MSG_NEW_PATH]);
#endif
" -A no dir auto-enter during filter\n"
" -b key open bookmark key (trumps -s/S)\n"
+ " -B use bsdtar for archives\n"
" -c cli-only NNN_OPENER (trumps -e)\n"
" -C 8-color scheme\n"
" -d detail mode\n"
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "aAb:cCdDeEfF:gHiJKl:nop:P:QrRs:St:T:uUVxh"))) != -1) {
+ : getopt(argc, argv, "aAb:BcCdDeEfF:gHiJKl:nop:P:QrRs:St:T:uUVxh"))) != -1) {
switch (opt) {
#ifndef NOFIFO
case 'a':
if (env_opts_id < 0)
arg = optarg;
break;
+ case 'B':
+ g_state.usebsdtar = 1;
+ break;
case 'c':
cfg.cliopener = 1;
break;