Skip to content

enum Tabular::Shell #

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"

Members#

Bash = 0#

A Bourne Again SHell simulator.

Fish = 1#

Zsh = 2#

A Z-SHell simulator.

Methods#

#bash?#

Returns true if this enum value equals Bash

View source

#fish?#

Returns true if this enum value equals Fish

View 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"

View source

#to_sym#

View source

#zsh?#

Returns true if this enum value equals Zsh

View source