pet icon indicating copy to clipboard operation
pet copied to clipboard

supporting a ShowCommand option which does exactly the same as --command

Open cxfcxf opened this issue 3 years ago • 1 comments

Issue #, if available: not really an issue but more like to make it more flexible in terms of showing command it ran, cause we found it useful, or simply default --command to be ture?

Description of changes: it might be easier to have --command option being a config option too, so people can define it in configuration file instead of each time adding an argument in the end of

pet exec --command

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

cxfcxf avatar Sep 25 '20 02:09 cxfcxf

Right now, the workaround on my side is using piping to| pbcopy and pasting it so I can have it visible. But I like this, even configurable to make it default.

seivan avatar Mar 02 '21 08:03 seivan

Hey @cxfcxf! I think this can even be done by default, what do you think?

I don't feel like the default behavior should be to hide the command that was run. Specially given that you have no way of seeing what was run after the fact (since it's not added to history).

@knqyf263 Do you by any chance remember why it is designed to be hidden by default?

RamiAwar avatar Feb 05 '24 20:02 RamiAwar

Hey @cxfcxf! I think this can even be done by default, what do you think?

I don't feel like the default behavior should be to hide the command that was run. Specially given that you have no way of seeing what was run after the fact (since it's not added to history).

@knqyf263 Do you by any chance remember why it is designed to be hidden by default?

yeah it can be done as default. i was trying to not affect default behavior as much as i can.

cxfcxf avatar Feb 05 '24 22:02 cxfcxf

I don't remember. We can change it.

knqyf263 avatar Feb 06 '24 02:02 knqyf263

Alright cool, let's do it. I think this might play well into a future ticket as well which will allow adding the command to shell history.

@cxfcxf Would you mind updating this PR to always print the following?

> $command

Just a fmt.Printf("> %s\n", command) that always executes, and removing the --command flag.

Took a few years but we're there 😀 🥳

RamiAwar avatar Feb 06 '24 21:02 RamiAwar

Alright cool, let's do it. I think this might play well into a future ticket as well which will allow adding the command to shell history.

@cxfcxf Would you mind updating this PR to always print the following?

> $command

Just a fmt.Printf("> %s\n", command) that always executes, and removing the --command flag.

Took a few years but we're there 😀 🥳

i removed show command, and just it have print command all the time

but i did not remove the command flag, cause it has been so long, i dont know what changes in between. if i go to remove all the command flag part, there will be conflict.

cxfcxf avatar Feb 06 '24 21:02 cxfcxf

No worries, I'll take it from here, thanks @cxfcxf!

RamiAwar avatar Feb 06 '24 21:02 RamiAwar