This is an interactive selector.
Make sure Xcode is installed first.
make
And then, You can find executable binary chooser
in .build/debug directory.
I recommend you to copy the binary into $HOME/bin directory.
For example, if you need to open a file interactively using the cat
command, you can use the sample code below.
ls | .build/arm64-apple-macosx/debug/chooser | xargs cat
And then you can select a file interactively.
> (o) LICENSE
( ) Makefile
( ) Package.resolved
( ) Package.swift
( ) README.md
( ) Sources
( ) Tests
I'm using these snippets as a command alias for daily use.
git branch | grep "\*" | awk "{ print \$2 }" | chooser | xargs -I{} git push origin {}
git branch --format="%(refname:short)" | chooser --multiple | xargs -I{} git checkout {}
git branch --format="%(refname:short)" | chooser --multiple | xargs -I{} git branch -d {}