]> git.nbdom.net Git - nb.git/commitdiff
bin/ovh-api
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 7 Feb 2017 00:13:28 +0000 (00:13 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 7 Feb 2017 00:13:28 +0000 (00:13 +0000)
bin/ovh-api

index 12aa66519a4cc73f14ee102778e8c9cc8da4da0e..89f6e3c1e59532926640ee3ddd57b65485689bc7 100755 (executable)
@@ -63,6 +63,7 @@ if (@ARGV and $ARGV[0] =~ /^(\w+):(\w+)(?::(\w+))?$/) {
 }
 
 @KEY or help();
+open STDOUT,'| jq .' if $Opt{jq};
 my $Api = OvhApi->new(type => OvhApi::OVH_API_EU, applicationKey => $KEY[0], applicationSecret => $KEY[1], consumerKey => $KEY[2]);
 
 # Auth
@@ -376,6 +377,7 @@ $NAME - Script to query ovh's api
 
 =head1 OPTIONS
 
+ option[jq]        Pipe stdout to | jq .
  option[sql]        Produce sql to update a database
  option[rows|r]     Print each rows of a table (eg /ip, /server, ...)
  option[method|m=s] Method (default: GET)