Jacob v0.1.1 JacobCli.Commands.Shell.InstallExtension View Source

Install a shell extension.

Link to this section Summary

Functions

This callback will be used by Jacob in order to initialize the argv

Install Jacob’s zsh or bash extension

Link to this section Functions

This callback will be used by Jacob in order to initialize the argv.

It will remove the first argument in the argv list as it always is the command name.

e.g. When calling ./jacob foo bar the argv are ["foo", "bar"] and Jacob turns that into ["bar"]

Then the modified argv will be sent through all the initializer that your command defines.

You may define an initializer by anotating an existing funtion with the @initializer attribute, or by using the add_initializer/2 macro.

Initializers have to be defined as public functions.

Examples

Anotation without options

@initializer true
def my_initializer(argv, _opts), do: argv

Anotation with options

@initializer %{my: option}
def my_initializer(argv, opts = %{my: option}), do: argv

Callback implementation for Jacob.Command.Concerns.HasInitializers.initialize/1.

Install Jacob’s zsh or bash extension.