apache / cloudstack-cloudmonkey

Apache Cloudstack Cloudmonkey
Apache License 2.0
91 stars 60 forks source link

fix: reuse cmk's CLI params to call piped cmd #114

Closed nettoclaudio closed 1 year ago

nettoclaudio commented 2 years ago

This fix makes possible to call piped commands in the cmk's prompt when using a profile else than default one.


Before this patch, we got a weird error while calling any piped command from a session started with a different profile (passed from command line parameters).

% cmk -p my-example-profile -o json
Apache CloudStack 🐵 CloudMonkey 6.2.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues

(my-example-profile) 🐱 > list projects | jq -r '.project[].name'
🙈 Error: exit status 4

After this one we got the right output:

% cmk-patched -p my-example-profile -o json
Apache CloudStack 🐵 CloudMonkey 6.2.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues

(my-example-profile) 🐱 > list projects | jq -r '.project[].name'
project01
project02