@@ -203,9 +203,11 @@ _comp_cmd_tar__preparse_cmdline()
203
203
204
204
for i in " $@ " ; do
205
205
case " $i " in
206
- --delete | --test-label)
206
+ --delete | --test-label | --catenate | --concatenate | --extract | --get | --update | --list | --append | --create )
207
207
tar_mode=${i: 2: 100}
208
- tar_mode_arg=$i
208
+ # FIXME: We don't set $tar_mode_arg since it's used for combined
209
+ # single letter options, but that means we don't handle
210
+ # compression formats.
209
211
break
210
212
;;
211
213
--* )
@@ -236,7 +238,7 @@ _comp_cmd_tar__file_option()
236
238
local ext=" $1 "
237
239
238
240
case " $tar_mode " in
239
- c)
241
+ c | create )
240
242
# no need to advise user to re-write existing tarball
241
243
_comp_compgen_filedir -d
242
244
;;
@@ -391,7 +393,7 @@ _comp_cmd_tar__adjust_PREV_from_old_option()
391
393
_comp_cmd_tar__extract_like_mode ()
392
394
{
393
395
local i
394
- for i in x d t delete; do
396
+ for i in x d t delete extract get list ; do
395
397
[[ $tar_mode == " $i " ]] && return 0
396
398
done
397
399
return 1
@@ -455,7 +457,7 @@ _comp_cmd_tar__detect_ext()
455
457
456
458
case " $tar_mode_arg " in
457
459
--* )
458
- # Should never happen?
460
+ # FIXME: get correct extensions for long options (gnu style)
459
461
;;
460
462
? (-)* [cr]* f)
461
463
ext=' @(tar|gem|spkg|cbt|xpbs)'
@@ -490,7 +492,7 @@ _comp_cmd_tar__gnu()
490
492
tar_mode tar_mode_arg old_opt_progress=" " \
491
493
old_opt_used=" " old_opt_parsed=()
492
494
493
- # Main mode, e.g. -x or -c ( extract/creation)
495
+ # Main mode, e.g. "x" or "c" or the long forms " extract" or "create"
494
496
local tar_mode=none
495
497
496
498
# The mode argument, e.g. -cpf or -c
@@ -685,8 +687,6 @@ _comp_cmd_tar__posix()
685
687
686
688
_comp_initialize -s -- " $@ " || return
687
689
688
- tar_mode=none
689
-
690
690
# relatively compatible modes are {c,t,x}
691
691
# relatively compatible options {b,f,m,v,w}
692
692
short_arg_req=" fb"
0 commit comments