Bug 87901 - Please add bash-completion for mbimcli
Summary: Please add bash-completion for mbimcli
Status: RESOLVED FIXED
Alias: None
Product: libmbim
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: Aleksander Morgado
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-31 11:14 UTC by marius
Modified: 2015-01-25 22:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description marius 2014-12-31 11:14:09 UTC
It would be nice to have bash-completion (and maybe for other shells?) for all of mbimcli's commands/options.

Maybe it would be possible to autogenerate it, either from "mbimcli --help-all", or the glib Commandline option parser system?
Comment 1 Aleksander Morgado 2015-01-25 20:24:50 UTC
Done in git master.
Comment 2 marius 2015-01-25 20:45:16 UTC
Great! But it is not complete, it seems?
Comment 3 Aleksander Morgado 2015-01-25 20:54:36 UTC
(In reply to marius from comment #2)
> Great! But it is not complete, it seems?

What do you mean not complete? It should take the command names from --help-all.
Comment 4 Aleksander Morgado 2015-01-25 20:56:15 UTC
If you just looked at the patch: the explicitly listed commands are because they require additional arguments. All the commands without additional arguments are not needed in the explicit list as they're taken directly from --help-all.
Comment 5 marius 2015-01-25 22:06:19 UTC
Ah, didn't see that in all the script magic. It works fine when I actually try to install it.

I just noticed that tabbing without any '-' entered gives nothing. That is probably how it should be when no input other than options is expected? In this case, if possible, it would be nice if tabbing without arguments would work as tabbing with "-" entered.
Comment 6 marius 2015-01-25 22:09:45 UTC
That is accomplished by removing the "if [[ $cur == -* ]]; then" check. I think that gives a better result with the current mbimcli.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.