What is corresponding `return_all` from `shell_run_command` in new `ShellOperation`?

I am using GitHub - PrefectHQ/prefect-shell: Prefect tasks and subflows for interacting with shell commands.

For old shell_run_command, it has return_all which can return all lines of stdout as a list.

from prefect_shell import shell_run_command

def run():
    return shell_run_command(command="xxx", return_all=True)

I am wondering what is corresponding one in ShellOperation?

from prefect_shell import ShellOperation

async def run():
    return await ShellOperation(commands=["xxx"]).run()

I am hoping to get all result during streaming like return_all from shell_run_command.

The reason I am asking is that this shell command xxx will return error code 1 (it does not mean fail in this case actually), and shell_run_command itself is a Prefect task which will always fail. While ShellOperation has more freedom, I can add try/except to add my logic to handle so that the task can continue running.

Thanks! :smiley:

I created a ticket at Have something like `return_all` from `shell_run_command` in new `ShellOperation`? · Issue #83 · PrefectHQ/prefect-shell · GitHub. however, I closed after.

The shell command I was using is rclone check --one-way --use-json-log --include="*.tdms" /tmp/motor hm-s3:my-bucket/motor. This will return error code 1 if it finds any missing file.
And ShellOperation not be able to return all results.

However, after I change to rclone copy --dry-run --include="*.tdms" /tmp/motor hm-s3:my-bucket/motor which does similar thing. It does same thing. However, this one does not return error code 1 and does return all results.

As the second command makes more sense in my case. Plus, in this case, ShellOperation works well. So I closed my ticket. :smiley: