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

Added propagating verbose to subcommands support #72

Closed
wants to merge 0 commits into from

Conversation

chl178
Copy link
Contributor

@chl178 chl178 commented Mar 15, 2023

Related Issue: #61
The following PR Added propagating verbose to subcommands support

Areas of discussion

In the Canasta-CLI, internal commands can propagate verbose to their internal subcommands, but can't propagate verbose to external subcommands called by exec.Command().
To get more info when executing external subcommands especially docker-compose, I passed the verbose flag to the external subcommands from their parent commands.

Changes made

  1. Added the 'GetVerbose()' function in the logging package
  2. Implemented a conditional statement before executing the external command to determine whether to include the '--verbose' argument based on the value of the verbose flag.

Test

Only docker-compose has the –-verbose option among these external commands, so the following show the commands successfully propagate verbose to docker-compose subcommands.
截屏2023-03-15 14 07 34
截屏2023-03-15 14 10 10

This is my first time contributing to the community. Any feedback or suggestions are greatly appreciated.

@chl178
Copy link
Contributor Author

chl178 commented Mar 15, 2023

@jeffw16 @yaronkoren

@jeffw16
Copy link
Member

jeffw16 commented Mar 16, 2023

@bawolff do you have time to take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants