Bug 1013776 - bash-completion script for tar only handles dashless style cmd line args
Summary: bash-completion script for tar only handles dashless style cmd line args
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-30 18:24 UTC by Mansour Behabadi
Modified: 2013-10-01 06:45 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-10-01 06:45:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch to fix the issue (4.53 KB, patch)
2013-09-30 18:25 UTC, Mansour Behabadi
no flags Details | Diff

Description Mansour Behabadi 2013-09-30 18:24:04 UTC
Description of problem:

An example of a dashless (BSD?!) style tar command is:
$ tar xf somefile.tar.bz2

as opposed to:
$ tar --extract -f somefile.tar.bz2


Version-Release number of selected component (if applicable): 2.1-3


How reproducible: always


Steps to Reproduce:

1. Go to a directory where you have a tar file (e.g. archive.tar.gz) and other non tar files (e.g. face.png)

2. Type the following at the shell prompt and press <tab> twice:

   (a)$ tar xzf <tab><tab>
   (b)$ tar xf archive.tar.gz <tab><tab>
   (c)$ tar uf archive.tar.gz <tab><tab>

   (d)$ tar -x -z -f <tab><tab>
   (e)$ tar -x -f archive.tar.gz <tab><tab>
   (f)$ tar --update -f deleteme.tar <tab><tab>

Actual results:

(a) only list of dirs and archives that end with tar.gz
(b) list of files inside the tar archive
(c) list of files inside the tar archive

(d) all the files in cwd
(e) all the files in cwd
(f) bash gets stuck until ctrl+c is pressed


Expected results:

(a) and (d), (b) and (e), (c) and (f) should behave the same but they clearly do not.

Additional info:

Notice example (f): the bash is stuck and it gives the impression that some processing is going on, while in reality tar is waiting for input (due to mishandling of input), making the user waiting for no reason.

Comment 1 Mansour Behabadi 2013-09-30 18:25:46 UTC
Created attachment 805447 [details]
patch to fix the issue

I re-wrote most of tar completion script and it now handles all types of cmd line options (ie single/double dash and dashless).

Comment 2 Mansour Behabadi 2013-09-30 18:27:11 UTC
I have also reported this issue upstream at http://alioth.debian.org/tracker/index.php?func=detail&aid=314457&group_id=100114&atid=413095

Comment 3 Ville Skyttä 2013-10-01 06:45:36 UTC
Closing UPSTREAM as this is not Fedora specific and it's already in upstream BTS.


Note You need to log in before you can comment on or make changes to this bug.