Skip to content

markryall/shell_shock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shell Shock

A library for creating command line shell application.

Rationale

  • command line tools are faster and cooler than any gui or web interface

  • tab completion is awesome

  • cutting and pasting code is bad

Installation

gem install shell_shock

Usage

The basic idea is that you create classes and include the ShellShock::Context mixin. Start a shell by instantiating the class and executing the push method. Any number of nested shells may be pushed and exit falls back to the previous shell.

These classes represent a shell context with a number of commands registered. These commands are matched with tab completion. In addition to registered commands, ‘exit’, ‘quit’, ‘help’ and ‘?’ are always available.

Each command must have an execute method that accepts a string (the remaining content after the command name). Commands may also implement usage and help methods. They may also implement a completion method so may have arbitrarily complex completion rules per parameter.

Refer to the examples directory for some sample shells.

About

a ruby library for creating command line shells with readline and tab completion support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages