Allow Poulpy commands to be ergonomic and easily chain-able
We want poulpy functions launched with restish to be ergonomic and easily chainable.
For instance we would like the following command (the command is not valid, it is for the sake of the example):
poulpy repo-submission get-batches -f '.batchList[].submissionSlug' | xargs -i poulpy repo-submission get-jobs-by-status {} --status UPLOADED
To be used like this:
poulpy run 'repo-submission get-batches -f ".batchList[].submissionSlug" | repo-submission get-jobs-by-status {.id} --status UPLOADED'
To do this we can:
- Make sure to add
-o json --body-only
options at the last call if it is a restish one. - Try to use the
format
function each time we encounter a{.*}
in a restish command, if it fails we just let restish handle it. Theformat
function failing probably mean that it is a body the user want to pass to restish. - Make sure the command fail at early as possible,