yadutaf / ovh-cli

Bare simple Command Line Interface (CLI) for OVH.
Other
31 stars 13 forks source link

Add a 'no-format' option for some endpoints such domain/zone/{domainName}/export #11

Closed ptitfred closed 7 years ago

ptitfred commented 7 years ago

Example:

$ ./ovh-eu domain zone fretlink.com export
<truncated>
google._domainkey                            in txt    "v=dkim1; k=rsa; p=mi gf ma0 gc sq gs ib3 dqebaquaa4 gnadc bi qk bg qc ux8f ao gd30 t cy ht zu9 oz m9p/xrzas2uk w cf f8 k hbif oei a ujku zj fg9 kn sw ig wk9e b pv o xu yi hz4 s7 l0g w ot zh cl1gy1wv1m+ dj tyf gb ovku0 h+u hk kz8 aaqr sd sq6y3 aw ygy1ad1r ai ua5 b tem vp lhsgvq n tf hh bi5 he z yt cpqidaqab"
<truncated>

Expected value:

"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCUx8fAOGd30TCyHtZU9OzM9p/XRZAS2ukWCfF8KHbifOeiAUjkuZjFg9KNSwIGWk9eBPvOXuYIHz4S7L0gWOtZhCL1gy1wv1m+DjTYFGbOvku0H+uHKKz8AaqrSdSq6y3AWYgy1ad1rAiUA5BTemVPLhsgvqNTfHhBi5HeZYtCPQIDAQAB"

Not sure if it's a bug in the CLI or in the API itself.

ptitfred commented 7 years ago

Not sure if it's a bug in the CLI or in the API itself.

It's ok in the --debug output.

All the output of the export command is downcased, which looks wrong :/

ptitfred commented 7 years ago

OK so the default (pretty) formatter doens't work well for that kind of endpoint :)

I've tried the bash but :

$ ./ovh-eu --format bash domain zone fretlink.com export
local variable 'value' referenced before assignment

JSON formatter is ok but I then need an extra step to reformat it to a clear text file.

echo console.log\($(./ovh-eu --format json domain zone fretlink.com export)\) | node

ptitfred commented 7 years ago

I've renamed the title to reflect my remarks.

yadutaf commented 7 years ago

Hmm, calling camel_to_human https://github.com/yadutaf/ovh-cli/blob/master/ovhcli/utils.py#L40 on values is a non-sense anyway. It should only be called for labels, as most of them are... well. I need to fix this.

yadutaf commented 7 years ago

I pushed a fix on branch fix-11. Can you confirm this fixes this issue ?

ptitfred commented 7 years ago

Yes, thanks a lot !