Skip to content

Commit

Permalink
Fix color disabling using -nc/--no-color option
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Sep 4, 2023
1 parent 374e37e commit 0651c0e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ Usage: rbinstall {options} version
Options
--reinstall, -R .......... Reinstall already installed version (if allowed in configuration file)
--uninstall, -U .......... Uninstall already installed version (if allowed in configuration file)
--reinstall-updated, -X .. Reinstall all updated (rebuilt) versions (if allowed in configuration file)
--gems-update, -G ........ Update gems for some version (if allowed in configuration file)
--rehash, -H ............. Rehash rbenv shims
--gems-insecure, -s ...... Use HTTP instead of HTTPS for installing gems
--ruby-version, -r ....... Install version defined in version file
--info, -i ............... Print detailed info about version
--all, -a ................ Print all available versions
--no-progress, -np ....... Disable progress bar and spinner
--no-color, -nc .......... Disable colors in output
--help, -h ............... Show this help message
--version, -v ............ Show version
--reinstall, -R Reinstall already installed version (if allowed in configuration file)
--uninstall, -U Uninstall already installed version (if allowed in configuration file)
--reinstall-updated, -X Reinstall all updated (rebuilt) versions (if allowed in configuration file)
--gems-update, -G Update gems for some version (if allowed in configuration file)
--rehash, -H Rehash rbenv shims
--gems-insecure, -s Use HTTP instead of HTTPS for installing gems
--ruby-version, -r Install version defined in version file
--info, -i Print detailed info about version
--all, -a Print all available versions
--no-progress, -np Disable progress bar and spinner
--no-color, -nc Disable colors in output
--help, -h Show this help message
--version, -v Show version
Examples
Expand Down
4 changes: 4 additions & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ func preConfigureUI() {

// configureUI configure user interface
func configureUI() {
if options.GetB(OPT_NO_COLOR) {
fmtc.DisableColors = true
}

switch {
case fmtc.IsTrueColorSupported():
colorTagApp, colorTagVer = "{#CC1E2C}", "{#CC1E2C}"
Expand Down
1 change: 1 addition & 0 deletions common/rbinstall.spec
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ rm -rf %{buildroot}
%changelog
* Fri Sep 01 2023 Anton Novojilov <[email protected]> - 3.1.0-0
- Added option -X/--reinstall-updated for updating rebuilt versions
- Fixed color disabling using -nc/--no-color option
- Dependencies update
- Code refactoring

Expand Down

0 comments on commit 0651c0e

Please sign in to comment.