From 6127681c92f8c5acb63d202724f55529a4a40e71 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Fri, 18 Mar 2016 13:50:38 -0400 Subject: [PATCH] Fix 'dogapi metric send' cli command --- lib/api/metric.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/api/metric.js b/lib/api/metric.js index 355009c..1cd2609 100644 --- a/lib/api/metric.js +++ b/lib/api/metric.js @@ -200,18 +200,14 @@ module.exports = { ] }, handleCli: function(subcommand, args, callback){ - if(subcommand === "send"){ + if(args._.length > 5 && subcommand === "send"){ var extra = {}; - if(args["--tags"]){ - extra.tags = args["--tags"].split(","); + if(args.tags){ + extra.tags = args.tags.split(","); } - if(args["--host"]){ - extra.host = args["--host"]; - } - if(args["--type"]){ - extra.metric_type = args["--type"]; - } - send(args[""], args[""], extra, callback); + extra.host = args.host; + extra.type = args.type; + send(args._[4], args._[5], extra, callback); } else if(subcommand === "query" && args._.length > 6){ var from = parseInt(args._[4]); var to = parseInt(args._[5]);