enum Tabular::Shell

Overview

Supported shell simulators for use with specs.

requires "tabular/shell"

Shell::Bash.simulate ["hello", "w"], "myprog"
Shell::Fish.simulate ["hello", "w"], "myprog"
Shell::Zsh.simulate ["hello", "w"], "myprog"

Defined in:

tabular/shell.cr

Enum Members

Bash = 0

A Bourne Again SHell simulator.

Fish = 1

A Friendly Interactive SHell simulator.

Zsh = 2

A Z-SHell simulator.

Instance Method Summary

Instance Method Detail

def bash? #

Returns true if this enum value equals Bash


[View source]
def fish? #

Returns true if this enum value equals Fish


[View source]
def simulate(words : Array(String), prog : String, *autoload, paths = [] of String, **vars) #

Simulate the completion of the words passed to prog and return the suggestions.

shell.simulate ["hello", "w"], "prog1"

Load completions for other programs by specifying autoloads:

shell.simulate ["hello", "w"], "prog1", "prog2", "prog3"

Any paths specified are prepended to the $PATH environment variable:

shell.simulate ["hel"], "prog1", paths: ["/home/me/bin"]

Any other environment variables may be set or overridden with vars:

shell.simulate ["hel"], GOPATH=: "/home/me/bin/go"

[View source]
def to_sym #

[View source]
def zsh? #

Returns true if this enum value equals Zsh


[View source]