completion for "mplayer -(cd|dvd)-device" should also complete directory names

Bug #661775 reported by Florian Schmidt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

The mplayer switch "-cdrom-device" and "-dvd-device" expect a device file or directory in which to find their data.
bash-completion version 1:1.2-2ubuntu1 will only complete devices, not directories. However, this is desirable, e.g., in case of videos in DVD format that are saved on a file system.

Patch to change this behavior is attached.

Tags: patch
Revision history for this message
Florian Schmidt (flosch42) wrote :

Sorry, last patch had whitespace issues.
updated version.

description: updated
Revision history for this message
Brian Fuller (slink3r) wrote :

I can't find the options -cdrom-device or -dvd-device in the standard mplayer package

Changed in bash-completion (Ubuntu):
status: New → Incomplete
Revision history for this message
Florian Schmidt (flosch42) wrote :

Hm, they are there... they are command line options. manpage excerpt (man mplayer)

       -dvd-device <path to device> (DVD only)
              Specify the DVD device or .iso filename (default: /dev/dvd). You can also specify a directory that contains files previ‐
              ously copied directly from a DVD (with e.g. vobcopy).
       -cdrom-device <path to device>
              Specify the CD-ROM device (default: /dev/cdrom).

Come to think of it, it probably doesn't make too much sense to provide -cdrom-device with a tab completion for directories. -dvd-device could probably get completion for *.iso files on top of directories though.

Revision history for this message
Brian Fuller (slink3r) wrote :

I get auto-completion already :\

tags: added: patch
Revision history for this message
Florian Schmidt (flosch42) wrote :

Do you get auto-completion for both devices and directories?
Say, as an example, we have a DVD drive accessible through /dev/dvd0, and a directory /path/to/dvd that contains a VIDEO_TS folder with DVD-format videos. I then notice the following:

Current behavior:
$ mplayer -dvd-device /dev/dv<TAB>
results in
$ mplayer -dvd-device /dev/dvd0

However
$ mplayer -dvd-device /path/to/d<TAB>
results in no found matches, i.e., nothing at all happens:
$ mplayer -dvd-device /path/to/d

The patch changes the behavior of the latter to complete the path to "/pat/to/dvd".

After some thinking, I changed the patch on my side and will upload the new version. The behavior after the patch is now:
1) for -cdrom-device it does not change the current behavior at all, because mplayer's manpage does not specify whether it is sensible or even possible to use directories or ISO images for this option, and I don't have any Video CDs here to test it.
2) for -dvd-device it also, in addition to the current completion behavior, takes into account .iso files and directories in the completion, because mplayer can read DVDs from ISO images or directories.

I will add the new patch to show the difference (it's only one line). Though I'm not sure, if other people can not reproduce the behavior, if it makes sense to pursue this bug. However, it would be weird if I was stung by a configuration problem that only occurs in my setup?
Also, I'm not sure whether it is the best idea to provide a patch for an /etc/ file, i.e., the location after the installation of the bash-completion package. But I guess that's something that the maintainer should decide?

Revision history for this message
Florian Schmidt (flosch42) wrote :

Do you get auto-completion for both devices and directories?
Say, as an example, we have a DVD drive accessible through /dev/dvd0, and a directory /path/to/dvd that contains a VIDEO_TS folder with DVD-format videos. I then notice the following:

Current behavior:
$ mplayer -dvd-device /dev/dv<TAB>
results in
$ mplayer -dvd-device /dev/dvd0

However
$ mplayer -dvd-device /path/to/d<TAB>
results in no found matches, i.e., nothing at all happens:
$ mplayer -dvd-device /path/to/d

The patch changes the behavior of the latter to complete the path to "/pat/to/dvd".

After some thinking, I changed the patch on my side and will upload the new version. The behavior after the patch is now:
1) for -cdrom-device it does not change the current behavior at all, because mplayer's manpage does not specify whether it is sensible or even possible to use directories or ISO images for this option, and I don't have any Video CDs here to test it.
2) for -dvd-device it also, in addition to the current completion behavior, takes into account .iso files and directories in the completion, because mplayer can read DVDs from ISO images or directories.

I will add the new patch to show the difference (it's only one line). Though I'm not sure, if other people can not reproduce the behavior, if it makes sense to pursue this bug. However, it would be weird if I was stung by a configuration problem that only occurs in my setup?
Also, I'm not sure whether it is the best idea to provide a patch for an /etc/ file, i.e., the location after the installation of the bash-completion package. But I guess that's something that the maintainer should decide?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for bash-completion (Ubuntu) because there has been no activity for 60 days.]

Changed in bash-completion (Ubuntu):
status: Incomplete → Expired
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.