GNOME Bugzilla – Bug 745157
nmcli: fix bash completion to treat colon ':' as a normal character instead of a separator
Last modified: 2020-11-12 14:28:22 UTC
Bug 738613 has added '--order' option to 'nmcli connection show' command. Let's implement bash completion for the option.
see https://bugzilla.gnome.org/show_bug.cgi?id=738613#c6 for a first attempt of a patch
Created attachment 297869 [details] [review] [PATCH] WIP: cli/completion: add completion for --order option Attaching Thomas Haller's WIP patch from https://bugzilla.gnome.org/show_bug.cgi?id=738613#c6
btw, this is a bit more grave then just a missing completion. The command line syntax for order uses colons, which confuses the current implementation of nmcli-completion, because bash completion interprets colon as a separator for words -- so it's not completely trivial to fix...
(In reply to Thomas Haller from comment #3) > btw, this is a bit more grave then just a missing completion. > > The command line syntax for order uses colons, which confuses the current > implementation of nmcli-completion, because bash completion interprets colon > as a separator for words -- so it's not completely trivial to fix... Would it help if we changed the separator to ',' instead of ':'?
(In reply to Jiri Klimes from comment #4) > (In reply to Thomas Haller from comment #3) > > btw, this is a bit more grave then just a missing completion. > > > > The command line syntax for order uses colons, which confuses the current > > implementation of nmcli-completion, because bash completion interprets colon > > as a separator for words -- so it's not completely trivial to fix... > > Would it help if we changed the separator to ',' instead of ':'? yes, then the implementation for nmcli-completion would be simple. but, ':' arguably looks better then ','. also, nmcli completion already has a problem with colons. We should fix that anyway and then the colons are fine. e.g. # suppose you have a connection name "Wired Connection 1" nmcli connection show foo:Wir<TAB>
I merged parts of attachment 297869 [details] [review] as http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=81c420dc6251f54c3358411093bcc902166fdb7a Now, completion for --order is implemented, but it breaks down if there are colons. The problem with colons is not specific to --order. I update the subject of the bug to reflect that.
Commit http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=91dde2c improves on the situation. But it's not always correct.
bugzilla.gnome.org is being shut down in favor of a GitLab instance. We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time. If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/ Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).