Skip to content

Avoid ANSI formatting when not on a TTY#7952

Merged
headius merged 2 commits intojruby:masterfrom
headius:help_notty_output
Oct 10, 2023
Merged

Avoid ANSI formatting when not on a TTY#7952
headius merged 2 commits intojruby:masterfrom
headius:help_notty_output

Conversation

@headius
Copy link
Member

@headius headius commented Oct 9, 2023

Fixes #7864.

Output before (jruby --help | less):

ESC[1mESC[1mUsage:ESC[0m jruby [switches] [--] [programfile] [arguments]ESC[0m
   ESC[1m-0[octal]ESC[0m                                           specify record separator (\0, if no argument) 
   ESC[1m-aESC[0m                                                  autosplit mode with -n or -p (splits $_ into $F) 
   ESC[1m-cESC[0m                                                  check syntax only 
   ESC[1m-CdirectoryESC[0m                                         cd to directory, before executing your script 
...

After:

Usage: jruby [switches] [--] [programfile] [arguments]
   -0[octal]                                           specify record separator (\0, if no argument) 
   -a                                                  autosplit mode with -n or -p (splits $_ into $F) 
   -c                                                  check syntax only 
   -Cdirectory                                         cd to directory, before executing your script 

@headius headius added this to the JRuby 9.4.4.0 milestone Oct 9, 2023
@headius headius marked this pull request as ready for review October 9, 2023 22:03
@headius headius merged commit 08fa1f6 into jruby:master Oct 10, 2023
@headius headius deleted the help_notty_output branch October 10, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--help and other output does not check TTY

1 participant