class Opal::CLI::Option

Overview

Represents a command-line flag or option.

Defined in:

opal/cli/option.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : Symbol, long : String, short : String | Nil = nil, description : String = "", type : Symbol = :string, default : OptionValue = nil, required : Bool = false, global : Bool = false, choices : Array(String) | Nil = nil, env_var : String | Nil = nil) #

[View source]

Instance Method Detail

def choices : Array(String) | Nil #

[View source]
def default : OptionValue #

[View source]
def description : String #

[View source]
def env_var : String | Nil #

[View source]
def flag? : Bool #

[View source]
def formatted_flag : String #

Formatted flag representation for help screens (e.g. "-e, --entry=DIR")


[View source]
def global? : Bool #

[View source]
def long : String #

[View source]
def name : Symbol #

[View source]
def required? : Bool #

[View source]
def short : String | Nil #

[View source]
def type : Symbol #

[View source]