Colors support for CLI output
See original GitHub issueHi,
we are using the Jdeploy library for deploying and running the CLI tool written on Java.
Jdeploy is a great tool and everything is fine except for one little issue with colors.
If I run it as a regular Java application, colors are displayed correctly:
But if I run it as a command after installation via Jdeploy, colors are disappeared:
Tried to edit the jdeploy.js file and add --colors
or --ansi
to the command (cmd
variable), but it doesn’t work:
Exception in thread "main" java.lang.RuntimeException: org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --colors
at ca.weblite.jdeploy.JDeploy.main(JDeploy.java:1174)
Caused by: org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --colors
at org.apache.commons.cli.DefaultParser.handleUnknownToken(DefaultParser.java:347)
at org.apache.commons.cli.DefaultParser.handleLongOptionWithoutEqual(DefaultParser.java:394)
at org.apache.commons.cli.DefaultParser.handleLongOption(DefaultParser.java:371)
at org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:239)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:120)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:76)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:60)
at ca.weblite.jdeploy.JDeploy.main(JDeploy.java:1145)
Exception in thread "main" java.lang.RuntimeException: org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --ansi
at ca.weblite.jdeploy.JDeploy.main(JDeploy.java:1174)
Caused by: org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --ansi
at org.apache.commons.cli.DefaultParser.handleUnknownToken(DefaultParser.java:347)
at org.apache.commons.cli.DefaultParser.handleLongOptionWithoutEqual(DefaultParser.java:394)
at org.apache.commons.cli.DefaultParser.handleLongOption(DefaultParser.java:371)
at org.apache.commons.cli.DefaultParser.handleToken(DefaultParser.java:239)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:120)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:76)
at org.apache.commons.cli.DefaultParser.parse(DefaultParser.java:60)
at ca.weblite.jdeploy.JDeploy.main(JDeploy.java:1145)
Is there any way to fix this issue?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Support colored output from original CLI · Issue #223 - GitHub
I would like to be able to have a --colors flag when running turbo to enable colors of the CLI output, including the...
Read more >bash - How to change the output color of echo in Linux
You can use these ANSI escape codes: Black 0;30 Dark Gray 1;30 Red 0;31 Light Red 1;31 Green 0;32 Light Green 1;32 Brown/Orange...
Read more >Color - A command-line color library with true color support ...
A command-line color library with 16/256/True color support, universal API methods and Windows support. 中文说明. Basic color preview: basic-color. Now, 256 ...
Read more >When should colors be used in a command line application?
When should colors be used in a command line application? When they help the readability of the content (and are not used as...
Read more >cli-color - npm
xTerm colors (256 colors table). Not supported on Windows and some terminals. However if used in not supported environment, the closest color ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had similar issue, you case might be different but this worked for me. I had Jansi in my JAR file, removing
jansi.jar
from my executable JAR helped fix it for me.Also try to update
jdeploy
’s dependencyshelljs
version to0.8.4
@ravn thanks a lot for the detailed investigation!