module Toys::Context::Key
Well-known context keys.
This module is mixed into the runtime context. This means you can reference any of these constants directly from your run method.
### Example
tool "my-name" do def run # TOOL_NAME is available here. puts "My name is #{get(TOOL_NAME)}" end end
Constants
- ARGS
Context
key for the argument list passed to the current tool. Value is an array of strings. @return [Object]- CLI
Context
key for the currently running {Toys::CLI}. You can use the value to run other tools from your tool by calling {Toys::CLI#run}. @return [Object]- CONTEXT_DIRECTORY
Context
key for the context directory path. The value is a string @return [Object]- DELEGATED_FROM
Context
key for the context from which the current call was delegated. The value is either another context object, or `nil` if the current call is not delegated. @return [Object]- LOGGER
Context
key for the active `Logger` object. @return [Object]- TOOL
Context
key for the {Toys::ToolDefinition} object being executed. @return [Object]- TOOL_NAME
Context
key for the full name of the tool being executed. Value is an array of strings. @return [Object]- TOOL_SOURCE
Context
key for the {Toys::SourceInfo} describing the source of this tool. @return [Object]- UNMATCHED_ARGS
Context
key for all unmatched args in order. The value is an array of strings. @return [Object]- UNMATCHED_FLAGS
Context
key for unmatched flags. The value is an array of strings. @return [Object]- UNMATCHED_POSITIONAL
Context
key for unmatched positional args. The value is an array of strings. @return [Object]- USAGE_ERRORS
Context
key for the list of usage errors raised. The value is an array of {Toys::ArgParser::UsageError}. @return [Object]- VERBOSITY
Context
key for the verbosity value. The value is an integer defaulting to 0, with higher values meaning more verbose and lower meaning more quiet. @return [Object]