Skip to content
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(cli): support no-color option on argo submit. Fixes #13801 #14137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pakio
Copy link

@pakio pakio commented Jan 29, 2025

Fixes #13801 (Partially relates to #12126)

Motivation

For better usability and to close #13801

Modifications

Add support for --no-color option on argo submit command.

Verification

Verified by running command with and without --no-color option.

❯ ./dist/argo submit -n test-argo --log examples/hello-world.yaml > with-color.log
❯ ./dist/argo submit -n test-argo --log examples/hello-world.yaml --no-color > no-color.log

❯ cat -v with-color.log
Name:                hello-world-rm2lv
Namespace:           test-argo
ServiceAccount:      unset (will run with the default ServiceAccount)
Status:              Pending
Created:             Wed Jan 29 23:34:38 +0000 (now)
Progress:
^[[31mhello-world-rm2lv: hello world^[[0m
^[[31mhello-world-rm2lv: time="2025-01-29T23:34:41.579Z" level=info msg="sub-process exited" argo=true error="<nil>"^[[0m

❯ cat -v no-color.log
Name:                hello-world-dwr7t
Namespace:           test-argo
ServiceAccount:      unset (will run with the default ServiceAccount)
Status:              Pending
Created:             Wed Jan 29 23:34:57 +0000 (now)
Progress:
hello-world-dwr7t: hello world
hello-world-dwr7t: time="2025-01-29T23:35:00.822Z" level=info msg="sub-process exited" argo=true error="<nil>"

Here you can see ^[[31m escape code when it's executed without --no-color option (default behavior)

@pakio pakio marked this pull request as ready for review January 29, 2025 23:48
@pakio pakio marked this pull request as draft January 30, 2025 00:02
Signed-off-by: Kazuma (Pakio) Arimura <[email protected]>
@pakio pakio marked this pull request as ready for review January 30, 2025 01:05
@pakio pakio marked this pull request as draft January 30, 2025 07:57
@pakio pakio marked this pull request as ready for review January 30, 2025 09:54
@pakio pakio changed the title feat: support no-color option on argo submit. Fixes #13801 feat(cli): support no-color option on argo submit. Fixes #13801 Jan 30, 2025
Copy link
Member

@MasonM MasonM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

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.

Add --no-color flag when submitting and logging: argo submit --from kind/name --log --no-color
2 participants