class Thyme::Option

Overview

Wraps the option extension in THYMERC_FILE configuration. Used by end users to extend Thyme with their own options and commands.

Defined in:

thyme/option.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String, flag : String, flag_long : String, description : String, command : String) #

[View source]

Class Method Detail

def self.parse(name, yaml) #

Parses YAML and returns a Thyme::Option. All fields are required.


[View source]
def self.validate!(yaml, name, key) #

Verifies key is available and is a String.


[View source]

Instance Method Detail

def call(option_args : NamedTuple) #

Calls #command as a system command. Replaces placeholders with actual values: #{flag} - value given to a flag #{args} - additional arguments given to the thyme command


[View source]
def description : String #

[View source]
def flag : String #

[View source]
def flag_long : String #

[View source]
def name : String #

[View source]