class Kommando::Namespace

Defined in:

kommando/namespace.cr

Constant Summary

HELP = ["help", "?"] of ::String
RESERVED_NAMES = HELP

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String) #

[View source]

Class Method Detail

def self.root(&) #

[View source]

Instance Method Detail

def command(cmd : Command::Meta, name : String = cmd.command_name) #

[View source]
def commands : Hash(String, Kommando::Command::Meta) #

[View source]
def commands(*cmds : Command::Meta) #

[View source]
def exec(args : Array(String) = ARGV, io : IO = STDOUT, err : IO = STDERR) #

Like #run, but prints execptions to stderr and exits the Process. This method makes the namespace act as a CLI.


[View source]
def help(args : Array(String), io : IO) #

[View source]
def name : String #

[View source]
def namespace(name : String | Symbol, &) #

[View source]
def namespaces : Hash(String, Kommando::Namespace) #

[View source]
def run(args : Array(String), io : IO = STDOUT) #

[View source]