Skip to content

Latest commit

 

History

History
94 lines (75 loc) · 3.49 KB

README.md

File metadata and controls

94 lines (75 loc) · 3.49 KB

Serve

Menu CLI tool

A very simple tool that receives a given number of options, displays them in a TUI menu and enables the selection of one of them. The user can choose between the options through vim keys (jk) and finally select an option through Enter. The selected option will then be written to stdout.

Usage

Serve can read a given string through the -o or --options flag and split it into options, which by default is separated through \n characters. Different delimiters can be chosen through the -d option. Additionally, serve recognizes when it is used in command chaining or piping and then proceeds to read the options from stdin. When reading from stdin however, serve can currently only delimit options through newlines.

Options:

usage: serve [options]
    -m, --mode      mode in which serve will execute, currently only one
    -o, --options   options to select from
    -p, --prompt    menu prompt
    -d, --delimiter string or char used to separate options, default is '\n'
    -h, --help      print usage

Example:

serve --prompt PROMPT --options "foo\nbar\nbaz"

usage

Dependencies

It simply uses Go's built in libraries and the amazing tcell library. So to be able to compile the project, it is only needed to have Go installed on your system

Arch-based

sudo pacman -S go

Debian-based

sudo apt install go

Installation

Steps

  1. make build: pulls necessary dependencies and builds the binary
  2. make install: installs it onto your system such that it is visible in $PATH (not complete)

License

This project is released under the MIT license 3.0. See LICENSE.

Contributions

Please follow the instructions in the contributions guide at CONTRIBUTING.md.

Thanks

Donations

I have a ko-fi and a buy-me-a-coffee account, so if you found this repo useful and would like to show your appreciation, feel free to do so!