From 5b370e41900053f9b3bee93fbf71d8b021a71ca9 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 5 Jul 2019 18:39:18 +0800 Subject: [PATCH] Align CLI generator with changes in string type handling There was some duplicated logic here. --- gen/clouderrorreporting1_beta1-cli/src/main.rs | 2 +- gen/drive2-cli/src/main.rs | 2 +- src/mako/lib/cli.py | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gen/clouderrorreporting1_beta1-cli/src/main.rs b/gen/clouderrorreporting1_beta1-cli/src/main.rs index 99e0b76f1e..a66620acc0 100644 --- a/gen/clouderrorreporting1_beta1-cli/src/main.rs +++ b/gen/clouderrorreporting1_beta1-cli/src/main.rs @@ -278,7 +278,7 @@ impl<'n> Engine<'n> { let (key, value) = parse_kv_arg(&*parg, err, false); match key { "timed-count-duration" => { - call = call.timed_count_duration(arg_from_str(value.unwrap_or("-0"), err, "timed-count-duration", "int64")); + call = call.timed_count_duration(value.unwrap_or("")); }, "time-range-period" => { call = call.time_range_period(value.unwrap_or("")); diff --git a/gen/drive2-cli/src/main.rs b/gen/drive2-cli/src/main.rs index 018a0c643a..9e9dbc6184 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -56,7 +56,7 @@ impl<'n> Engine<'n> { call = call.start_change_id(value.unwrap_or("")); }, "max-change-id-count" => { - call = call.max_change_id_count(arg_from_str(value.unwrap_or("-0"), err, "max-change-id-count", "int64")); + call = call.max_change_id_count(value.unwrap_or("")); }, "include-subscribed" => { call = call.include_subscribed(arg_from_str(value.unwrap_or("false"), err, "include-subscribed", "boolean")); diff --git a/src/mako/lib/cli.py b/src/mako/lib/cli.py index d478db304c..3c73494b93 100644 --- a/src/mako/lib/cli.py +++ b/src/mako/lib/cli.py @@ -151,8 +151,6 @@ def docopt_mode(protocols): # Returns a possibly remapped type, based on its name. # Useful to map strings to more suitable types, i.e. counts def actual_json_type(name, type): - if type == 'string' and 'Count' in name: - return 'int64' return type # return a string representing property `p` suitable for docopt argument parsing