swupd-client icon indicating copy to clipboard operation
swupd-client copied to clipboard

hashdump completion should complete files/directories

Open phmccarty opened this issue 8 years ago • 5 comments

If I type swupd hashdump <TAB>, I would like to see a list of files and directories for completion candidates as well as the current list of hashdump command line options. This is useful because hashdump requires a filename as an argument.

phmccarty avatar Dec 05 '17 22:12 phmccarty

Certainly possible. Bash completion already has options other than tab for completing files (Meta-/ in particular is bound to complete-filename in the default emacs based keyboard bindings) . The issue is more do we want to have a bash completion script in the source, or do we want to have a script that writes the script in the source. As we add more special cases (bundle-add and bundle-remove are already special) the program to write the script becomes more complicated than the script!

icarus-sparry avatar Dec 05 '17 23:12 icarus-sparry

@icarus-sparry I'm inclined to defer to your judgement on that.

matthewrsj avatar Feb 27 '18 20:02 matthewrsj

I would love to remove the script that writes the completion script.

Whilst Rob Pike can design a new language and write a compiler for it just to be able to write essentially one program in it, I think the complexity of the completion script is not worthy of us doing the same.

icarus-sparry avatar Feb 27 '18 21:02 icarus-sparry

+1, fine with me.

matthewrsj avatar Feb 27 '18 21:02 matthewrsj

+1 with removing the autogeneration of the completion script. The motivation for implementing autogeneration originally was to save time for the maintainer, but as the completion needs grow more complex over time, the autogeneration turns into more of a nuisance.

phmccarty avatar Feb 27 '18 21:02 phmccarty