-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Added --disableANSI Flag to CLI to enable/disable ANSI Color Codes #1526
Conversation
Signed-off-by: Akash <akashsingh2210670@gmail.com>
@slayerjain Kindly review the PR and let me know if any changes are required. |
Also fix the merge conflicts please |
Signed-off-by: Akash <akashsingh2210670@gmail.com>
Signed-off-by: Akash <akashsingh2210670@gmail.com>
@PranshuSrivastava Kindly review this PR and have a look at the attached video to better understand the implementation, Thank You! |
Signed-off-by: Akash <akashsingh2210670@gmail.com>
Signed-off-by: Akash <akashsingh2210670@gmail.com>
Signed-off-by: Akash <akashsingh2210670@gmail.com>
… into colorcodeflag
Signed-off-by: Akash <akashsingh2210670@gmail.com>
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
Ok, the first log can be left colored as we haven't fully read the flags by that time, but the second log is being printed by you right? So why can't you just print it after changing the colors instead of before it? |
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
… into colorcodeflag
@PranshuSrivastava Your requested changes have been made |
cli/provider/cmd.go
Outdated
@@ -219,6 +219,7 @@ func (c *CmdConfigurator) AddFlags(cmd *cobra.Command) error { | |||
case "keploy": | |||
cmd.PersistentFlags().Bool("debug", c.cfg.Debug, "Run in debug mode") | |||
cmd.PersistentFlags().Bool("disableTele", c.cfg.DisableTele, "Run in telemetry mode") | |||
cmd.PersistentFlags().Bool("enableANSIColor", c.cfg.EnableANSIColor, "Enable ANSI color in logs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are working correctly, just change the name of this flag to "enableANSI". Currently the name feels too long to type for a flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
… into colorcodeflag
@PranshuSrivastava Your requested changes have been made |
Hey @Akash-Singh04, I think the flag should be |
@re-Tick Yes thats good. I just want the name to be short |
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
@re-Tick @PranshuSrivastava Your requested changes have been made |
Signed-off-by: Akash Singh <akashsingh2210670@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related Issue
Closes: #1520
Describe the changes you've made
--enableANSIColor
PersistantFlag to CLI to enable/disable ASNI Color CodesExample of enabled ANSI Colors in Log files:
Type of change
Please let us know if any test cases are added
NIL
Describe if there is any unusual behaviour of your code(Write
NA
if there isn't)NIL
Checklist:
Screenshots (if any)
Usage:
** |
![image](https://private-user-images.githubusercontent.com/114267538/303106649-08b65cb7-f118-4872-8a2c-bf61a6c24b60.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4MzA2OTgsIm5iZiI6MTcyMTgzMDM5OCwicGF0aCI6Ii8xMTQyNjc1MzgvMzAzMTA2NjQ5LTA4YjY1Y2I3LWYxMTgtNDg3Mi04YTJjLWJmNjFhNmMyNGI2MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNFQxNDEzMThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMGU1ZDBlZDFjNDBkOTMxOTMyNzg0OWI2ZGU2ZjFjNmQ2MDI4NTFiNzdhMmYwNDI5Nzk4ZDRlOTI0ZTNiZTQyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.zso7LzJAkcc4mKtPYbgR7xl6cA6jotptWZ7xseXg_mU)
|
Below is an attached video of the implementation in action:
bandicam.2024-02-09.03-38-03-218.2.1.mp4