class Git::Commands::ConfigOptionSyntax::GetColor
Retrieve an ANSI color string from config
Wraps ‘git config –get-color` to look up a color configuration and output the ANSI escape sequence for that color.
@example Get a color config value
cmd = Git::Commands::ConfigOptionSyntax::GetColor.new(lib) cmd.call('color.diff.new')
@example Get a color config value with a default
cmd = Git::Commands::ConfigOptionSyntax::GetColor.new(lib) cmd.call('color.diff.new', 'green')
@note ‘arguments` block audited against git-scm.com/docs/git-config/2.53.0
@see Git::Commands::ConfigOptionSyntax
@see git-scm.com/docs/git-config git-config documentation
@api private
Public Instance Methods
Source
# File lib/git/commands/config_option_syntax/get_color.rb, line 89 def call(*, **) super end
@overload call(name, default = nil, **options)
Execute the `git config --get-color` command @param name [String] the color config key name to look up @param default [String, nil] (nil) fallback color when the key is not set @param options [Hash] command options @option options [Boolean, nil] :global (nil) read from global config (`~/.gitconfig`) @option options [Boolean, nil] :system (nil) read from system config @option options [Boolean, nil] :local (nil) read from repository config (`.git/config`) @option options [Boolean, nil] :worktree (nil) read from worktree config @option options [String] :file (nil) read from the specified file Alias: :f @option options [String] :blob (nil) read from the specified blob @option options [Boolean, nil] :includes (nil) respect include directives in config files (`--includes`) @option options [Boolean, nil] :no_includes (nil) suppress include directive processing (`--no-includes`) @return [Git::CommandLine::Result] the result of calling `git config --get-color` @raise [ArgumentError] if unsupported options are provided @raise [Git::FailedError] if git exits with a non-zero exit status @api public
Calls superclass method
Git::Commands::Base::call