enum

Tabular::Shell

Inherits Enum < Comparable < Value < Object

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"

Constants

Bash = 0

A Bourne Again SHell simulator.

Fish = 1
Zsh = 2

A Z-SHell simulator.

Instance methods

bash?

Returns true if this enum value equals Bash

Source
fish?

Returns true if this enum value equals Fish

Source
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"
Source
to_sym
Source
zsh?

Returns true if this enum value equals Zsh

Source