Search code examples
pythonautocompletefish

fish shell tab completion program short description - howto?


With fish shell there is (among many others) a nice feature that displays a short description of the possible commands, like that:

enter image description here

How can I write such a description for my own commands? Specifically I would like to do that for python console_scripts.

10x.


Solution

  • You can add such descriptions to your Fish functions, such as this example from VirtualFish's activate sub-command:

    function __vf_activate --description "Activate a virtualenv"
        […]
    end
    

    You can see the resulting output when typing vf and then the Tab key:

    Descriptions of VirtualFish sub-commands