abstract class Cmds::Cmd

Included Modules

Defined in:

cmds/cmd.cr

Constant Summary

ARGS_HINTS = Hash(String, String | ::Nil).new
NAME = "(name not found)"

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.cmd_name #

[View source]
def self.desc(task : String, text : String) #

[View source]
def self.descs : Hash(String, Array(Desc)) #

[View source]
def self.pretty_usage(prefix : String = "", delimiter : String = " ") #

should be overriden in inherited macro


[View source]
def self.run(args : Array(String)) #

[View source]
def self.task_names : Array(String) #

[View source]
def self.usage(text : String) #

[View source]
def self.usages : Array(Usage) #

[View source]

Instance Method Detail

def args : Array(String) #

def args=(v : Array(String)) : Array(String) #

def args=(v : Nil) #

nil assignments are always ignored


def args? : Array(String) | Nil #

def error : Exception #

def error=(v : Exception) : Exception #

def error=(v : Nil) #

nil assignments are always ignored


def error? : Exception | Nil #

def original_args : Array(String) #

def original_args=(v : Array(String)) : Array(String) #

def original_args=(v : Nil) #

nil assignments are always ignored


def original_args? : Array(String) | Nil #

def prog_name : String #

def prog_name=(v : String) : String #

def prog_name=(v : Nil) #

nil assignments are always ignored


def prog_name? : String | Nil #

def read_arg_idx : Int32 #

def read_arg_idx=(v : Int32) : Int32 #

def read_arg_idx=(v : Nil) #

nil assignments are always ignored


def read_arg_idx? : Int32 | Nil #

def task_name #

[View source]
def task_name=(v : String) : String #

def task_name=(v : Nil) #

nil assignments are always ignored


def task_name? : String | Nil #

def task_state : Cmds::State #

def task_state=(v : Nil) #

nil assignments are always ignored


def task_state=(v : Cmds::State) : Cmds::State #

def task_state? : Cmds::State | Nil #

Macro Detail

macro task(name, args_hint = nil) #

[View source]