Skip to content

frixxx/simple-select

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

simple-select

A tool to create simple select functionality in bash scripts.

You provide an array of strings and select one from the shown list with the keyboard. On Enter the selected index will be output.

Install

Using the Homebrew package manager.

brew tap frixxx/tap
brew install simple-select

Usage

arr=( "a" "b" "c" )

simple-select "${arr[@]}"

echo "${arr[@]:$?:1}"

ATTENTION: Use ${arr[@]:$?:1} to interoperate between bash and zsh shells. Please do not use something in the style of ${arr[$i]} because you might get the wrong values! ZSH and Bash start at a different index in arrays

License

License: MIT

About

A tool to create simple select functionality in bash scripts.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages