Open lgbaldoni opened 4 years ago
this is a problem with your shell's tab completion. You can use the legacy option syntax -sub-file
to work around this.
this is a problem with your shell's tab completion. You can use the legacy option syntax -sub-file to work around this.
Error parsing commandline option sub-file: option requires parameter
Make sure you're using e.g. '--sub-file=value' instead of '--sub-file value'.
Could you be more specific about shell problem? It's bash 4.4.23: is it too old? Or should I set some variable?
5.0 is latest, lol.
Not everyone uses rolling releases distros. Can you confirm mpv requires bash 5.0 for its bash completion to function properly?
Could you be more specific about shell problem? It's bash 4.4.23: is it too old? Or should I set some variable?
The issue is that --foo bar
used to work, but now if two --
are used for an option which takes a value, then it must be used as --foo=bar
. Additionally -foo bar
always worked as well, and still works.
Some shells don't try to complete immediately files after =
, at which case you can use the alternative syntax of -foo bar
(note: one -
and not two) which would restore your shell completion.
The issue is that --foo bar used to work, but now if two -- are used for an option which takes a value, then it must be used as --foo=bar
Will it work with bash 5.0? Does it work for you?
at which case you can use the alternative syntax of -foo bar
Actually no, mpv complains about the missing =
and exits.
at which case you can use the alternative syntax of -foo bar
Actually no, mpv complains about the missing
=
and exits.
Are you sure? For me mpv --log-file=my.log
and mpv -log-file my.log
work, while mpv --log-file my.log
fails because =
is not used.
Actually no, mpv complains about the missing
=
and exits.
Post what you typed in then, and the output it gave. If mpv doesn't accept legacy option syntax, it's a bug, but to confirm that's what's happening, we need you to post you trying to use legacy option syntax, which I am 99.9999% sure you're not and you're still typing two dashes.
@CounterPillow you were right, legacy syntax works.
But it's going to be phased out at some point, I suppose. Is it a matter of bash version for the new one to work? Or possibly some variable to set?
This is a gap in the bash completion, but it could be made to work with some effort.
@philipl sorry, a "gap" with what?
Could someone please tell me if the problem is with bash, with the bash-completion script coming with mpv or yet something else?
A functional gap. It doesn't handle options that take a filename today. Someone would have to write new logic into the bash-completion script to handle it.
Ok, so it is a real bug.
@CounterPillow does it work for you?
For completeness, we do auto-complete files for options that have a [file]
type, but options such as sub-file
aren't like that, so we need additional logic to detect them correctly.
Concretely, that means you could use --sub-files=
and that would autocomplete. --sub-file
is an alias for --sub-files-append
which means it adds to the existing list while --sub-files=
replaces the list. Depending on your use-case, that may be fine.
@ValZapod Couldn't find mpv in the package filelist here.
Besides that, can you confirm that you have a working bash completion for mpv on debian sid?
But it's going to be phased out at some point, I suppose
As far as I remember, it has been un-deprecated (it used to have a warning before) and will remain around specifically for simple tab completion reasons.
Important Information
Provide following Information:
the relevant file (etc/mpv.bash-completion) appears to be the same as master
Reproduction steps
the problem occurs before launch
type
mpv testfile.mpv --sub-file=
and hit tab.Expected behavior
Filename to be completed.
Actual behavior
Nothing happens.
Log file
Does not apply.
Sample files
Does not apply.