Prefix my custom CLI commands with a comma and fish function descriptions
I think I’ve read about this years ago somewhere, just thought of it
For all my (fish) CLI aliases a , is an OK prefix to use, it even supports completion.
alias ,isodate='date +%F'
No idea about any downsides yet, will play with this for a week or so.
function ,blist -d "search and show bitwarden credentials"
command bw list items --search "$argv" | jq '.[].login | [.username, .password]' -c
end
function ,bcp -d "copy password of the first matching bitwarden item"
command bw list items --search $argv | jq .[0].login.password -r | xc
echo "copied password for '$argv'"
end
# etc, I see potential here!
``
Also TIL: fish functions can have a description that will be shown when tab completing! function functionname -d 'function description'
Isn’t it beautiful?
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus