snap info could autocomplete against installed snaps

Bug #1660970 reported by Mark Shuttleworth on 2017-02-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
John Lenton

Bug Description

Without really thinking about it I found myself hitting tab to autocomplete 'snap info roc...' based on what I knew to be installed snaps. I can see a debate about autocompleting against both installed vs store snaps, but for now at least it would be very fast to autocomplete against installed snaps for commands like 'info'.

 - interfaces
 - run

John Lenton (chipaca) wrote :

snap info will complete against "any snap name", meaning it will complete directories (so you can find .snaps or directories that have a meta/snap.yaml), installed snaps, and remote snaps. This isn't a priority order, but the remote snaps will only complete if you give it at least three characters to search for (this is the only part that is weird I think, but knowing it also allows you to cheat). It seems to work well for me: having the 'http' snap installed, in a directory with a 'httputil' subdirectory, 'snap info ht<tab>' completes to http and a second tab will offer http, httpstat, and httputil/, as expected. Having rocketchat-server installed, "snap info ro<tab>" offers rocketchat-server, whereas "snap info roc<tab>" only completes as far as rocketchat- because of it now also doing a remote search and finding more stuff.

I'll look into making snap interfaces complete; I thought that was done already (it's probably going to be a two-liner diff to make it work, as the completion logic is already done for connect)

And snap run should be doable :-) I'll get on it in a bit. I think it's the only one completing on so it'll be more work.

John Lenton (chipaca) on 2017-04-20
Changed in snapd:
assignee: nobody → John Lenton (chipaca)
importance: Undecided → Medium
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers