abstract class CliGen::BaseCommandNode

Overview

Non-generic base that lets the tree hold heterogeneous CommandNode(T) children. Everything that doesn't depend on T lives here.

Direct Known Subclasses

Defined in:

cligen/command_node/base.cr

Constant Summary

Log = ::Log.for(CliGen::CommandNode)

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, flags : Array(BaseFlag), commands : Array(BaseCommandNode), pre_run_commands : Array(RunCommand), post_run_commands : Array(RunCommand), meta : CommandMeta, description : String | Nil = nil) #

Instance Method Detail

def all_flags : Array(BaseFlag) #

abstract def check! : Nil #

def check_for_duplicate_flags!(flags : Array(BaseFlag)) : Nil #

def check_for_duplicate_subcommands! #

def commands : Array(BaseCommandNode) #

def description : String | Nil #

def find_match(arg : String) #

def flag?(arg : String) : BaseFlag | Nil #

def flags : Array(BaseFlag) #

def get(*, long : String) : BaseFlag | Nil #

def get(*, short : String) : BaseFlag | Nil #

def handle_flag_raises(&) : Nil #

def meta : CommandMeta #

def name : String #

def process(args : Array(String)) : Nil #

Converts String array to Arg array and hands off to the typed process method


abstract def process(args : Array(CliGen::Arg)) : Nil #

def subcommand?(arg : String) : Bool #

abstract def subcommands : Array(SubCommandInfo) #

def subcommands? : Bool #