-
Notifications
You must be signed in to change notification settings - Fork 33
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
Getting raw command output for processing #9
Comments
I've forked Shunt and added the functionality I needed, but I don't want to send a pull request until I understand something first. Here's my commit: Note that in my fork, I am silencing the output for commands that are run with retval=TRUE since I'm assuming the output is not relevant. It is not totally clear to me what retval even contains, but it doesn't seem to be the command's return value unless I'm missing something. |
Hey @kamermans
Passing second argument to The output stream itself (or raw output) will be printed via php standard output. If we want to store these output stream somewhere, there should be a valid use-case. Can you give one? |
Hi @toopay Thanks for the quick response. My use case is as follows. I'm building a user management system that keeps track of which users and SSH keys are in use at each server. Here is a task that I'm using with my fork of Shunt right now to accomplish this:
Note the use of |
I'll keep this issue open. Will work on it these week. |
First, thanks for the extraordinary package :)
Secondly, inside my tasks, I would like to access the raw output from the SSH command that was run so I can make decisions. After a couple hours of trying to creatively inject my custom
CapturedOutput
outputter into the doRun() function, I realized that this outputter is not used for command output, since theShunt
object has its own outputter that it got during instantiation. It seems to me that getting the raw output would be useful for others as well, so why not do one of these:Shunt::run()
calledOutputInterface $command_output
so we can pass in a custom Outputter to grab the raw output of the command.ArbitraryCommand
itself, along with the return value and maybe some timing information so you can do::getDuration() ::getStartTime() ::getEndTime()
, etc, from the command.I think no. 1 would be the most convenient, what you do you think?
Here's my very basic
CapturedOutput
class that I referenced:The text was updated successfully, but these errors were encountered: