abstract class Cli::Supercommand

Overview

The base of supercommand classes.

Defined in:

lib/supercommand.cr

Macro Summary

Instance methods inherited from class Cli::CommandBase

args args, err err, error!(message : String | Nil = nil, code : Int32 | Nil = nil, help : Bool = false, indent = 2) error!, exit!(message : String | Nil = nil, error : Bool = false, code : Int32 | Nil = nil, help = false, indent = 2) exit!, help!(message : String | Nil = nil, error : Bool | Nil = nil, code : Int32 | Nil = nil, indent = 2) help!, io io, nameless_args : Array(String) nameless_args, options options, out out, print(*args) print, puts(*args) puts, run run, unparsed_args : Array(String) unparsed_args, version : String version, version! version!, version? : String | Nil version?

Class methods inherited from class Cli::CommandBase

command_name(value : String) command_name, disable_help_on_parsing_error! disable_help_on_parsing_error!, generate_bash_completion generate_bash_completion, generate_zsh_completion(functional : Bool = true) generate_zsh_completion, version(value : String) version

Macro Detail

macro command(name, default = false, aliased = nil) #

Sets subcommand attributes.

Parameters

  • name (String) : a target subcommand name
  • default (Bool) : if true, it makes the target subcommand a default subcommand.
  • aliased (String) : makes the target subcommand an alias of the other subcommand that has the aliased name.

[View source]