Add auto-complete support for various office file format zip files

Bug #675987 reported by Jeroen Hoek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

Background:

I am working on a project which involves processing OOXML (Microsoft Office zipped XML fileformat) and ODF (OpenDocument zipped XML fileformat) documents. Often, to debug, or to directly alter files inside of these files, I unzip them somewhere to work on the XML-files inside of these zip-archives.

Problem:

From the command line, unzip doe not autocomplete some of these files because the auto-complete file doesn't know they are valid zip-files.

Missing file extensions:

Presently, bash-completion uses this line for unzip and zipinfo:

complete -f -X '!*.@(zip|ZIP|[ejw]ar|[EJW]AR|exe|EXE|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub)' unzip zipinfo

Some of the ODF extensions are already present. I would like to extend this list with all of the more common ODF and OOXML file extensions:

docx
dotx
docm
dotm
pptx
potx
pptm
potm
xlsx
xltx
xlsm
xltm

odt
ott
ods
ots
odp
otp
odc
otc
odg
otg
odf
otf
odm

The above can combined for use in that combine string:

ot[tspgfc]
od[tspgfcm]
dot[xm]
doc[xm]
p[op]tx
p[op]tm
xlt[xm]
xls[xm]

Or even more compact if more than one [] section is possible:

o[dt][tspgfc]
odm
do[tc][xm]
p[op]t[xm]
xl[ts][xm]

Revision history for this message
Jeroen Hoek (mail-jeroenhoek) wrote :

Having these file extensions auto-complete is also useful for users who simply want to extract all images from an office file. Both ODF and OOXML store the images used inside of office documents as binary files inside of the office zip-archives.

Revision history for this message
Ken Sharp (kennybobs) wrote :

Can you submit a patch upstream?

Revision history for this message
Jeroen Hoek (mail-jeroenhoek) wrote :
Revision history for this message
Ken Sharp (kennybobs) wrote :

Have you received a bug number back?

Revision history for this message
Jeroen Hoek (mail-jeroenhoek) wrote :

Ken:

The patch I sent has been applied upstream. I guess it will be available from Ubuntu 12.10 onwards?

See:
http://lists.alioth.debian.org/pipermail/bash-completion-devel/2012-July/004524.html

Revision history for this message
Ken Sharp (kennybobs) wrote :

Quantal is in code freeze. Should be in 13.04.

tags: added: patch-accepted-debian
Changed in bash-completion (Ubuntu):
status: New → Confirmed
Changed in bash-completion (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.