Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

tristanpenman/micromenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

μMenu

Gem Version

A cute little menu system written in Ruby 🥰

Installation

From GitHub:

git clone git@github.com:tristanpenman/micromenu.git
cd micromenu
gem build micromenu.gemspec
gem install ./micromenu-*.gem

From RubyGems:

gem install micromenu

Usage

Once it's in your path, you can run μMenu from anywhere using um.

$ cd examples
$ um
✨ μMenu ✨
Select an action: (Use ↑/↓ arrow keys or numbers to select)
‣ 1) 📁 group-a
  2) 📁 group-b

The directory group-b contains a sub-directory subgroup-a, so you can navigate down to that.

When an executable file is discovered, you will be prompted to provide arguments for it.

Starting directory

Running um with a particular path as its first argument will change the working directory before doing anything else. e.g:

um examples

The output from running um examples should look like this:

$ um examples
✨ μMenu ✨
Select an action: (Use ↑/↓ arrow keys or numbers to select)
‣ 1) 📁 group-a
  2) 📁 group-b

This is designed so that you can create bash aliases and the like. For example, I have a collection of scripts that I use in my work at Vivi, so I have created an alias called umv.

I also have another called um64 for N64 development.

Arguments

If you pass in a complete selection of navigation arguments, then any remaining arguments will be passed to the child process. For example:

$ um examples 1 1 hello world
✨ μMenu ✨
⤷ group-a
⤷ simon-says
hello world

Acknowledgements

μMenu makes good use of tty-prompt, which really keeps things simple. Shout out to Piotr Murach for creating it!

License

This code is licensed under the MIT License.

See the LICENSE file for more information.