CanastaWiki / Canasta-CLI

The Canasta command line interface, written in Go
MIT License
5 stars 14 forks source link

Enhancement for Issue #61: Provide Real-Time Output for External Subcommands #73

Closed chl178 closed 9 months ago

chl178 commented 1 year ago

Issue #61 brings attention to the problem of insufficient information when running external subcommands, such as docker-compose. While it may seem that passing the verbose flag to subcommands could resolve this issue, I believe it's not enough. This is because our Run() function currently only prints the output of external commands after they have finished executing.

Thus, even if we pass verbose to the external subcommand, we would only receive the information after it has completed its work.

To address this limitation, I propose that we modify the Run function to provide users with real-time output from external commands. This way, they can have all the information they need to understand what is happening during long-running commands as they happen, instead of having to wait until the command is finished.

chl178 commented 1 year ago

@jeffw16 @yaronkoren @amalpaul54111 would you please take a look at this?

amalpaul54111 commented 1 year ago

Yes,I feel like this is the way to go.

amalpaul54111 commented 1 year ago

I had tried to solve the particular issue, but main issue I faced was not being able to print live output along with saving it to a variable, which is necessary for taking decisions following it or to print the output after exiting due to an error in case --verbose was not used.

aerowisca commented 1 year ago

@amalpaul54111 @jeffw16 I'd like to take a shot at it (if it isn't being actively worked on currently).

jeffw16 commented 1 year ago

@chl178 I agree with you that we should do this. Did you want to write the code to do this?

chl178 commented 1 year ago

Yeah, I would like to do it.

jeffw16 commented 1 year ago

@aerowisca Thank you for your understanding to allow the issue author to work on their own proposal. :)

aerowisca commented 1 year ago

Yeah, sure thing.

Also, @amalpaul54111 as for your concern : That should be easy to accomplish, we can set cmd.Stdout to os.Stdout, and at the same time pipe the cmd.Stdout to a bytes.Buffer that will help us later in case the verbose option isn't used.