mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2025-12-31 00:21:44 +01:00
chore(code-update):added latest version of api+cli
APIs have additional files thanks to the build-script requirement. CLI has just seen minor changes though, making it usable with a stable compiler.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// DO NOT EDIT !
|
||||
// This file was generated automatically from 'src/mako/cli/main.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
#![feature(plugin, exit_status)]
|
||||
#![allow(unused_variables, unused_imports, dead_code, unused_mut)]
|
||||
|
||||
#[macro_use]
|
||||
@@ -22,7 +21,7 @@ mod cmn;
|
||||
|
||||
use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg,
|
||||
input_file_from_opts, input_mime_from_opts, FieldCursor, FieldError, CallType, UploadProtocol,
|
||||
calltype_from_str, remove_json_null_values};
|
||||
calltype_from_str, remove_json_null_values, ComplexType, JsonType, JsonTypeInfo};
|
||||
|
||||
use std::default::Default;
|
||||
use std::str::FromStr;
|
||||
@@ -64,9 +63,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &["get-stats"]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["get-stats"].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +92,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -114,9 +115,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &[]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend([].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,9 +160,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &[]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend([].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +189,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -194,8 +199,9 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
fn _tasks_insert(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
let mut request = api::Task::default();
|
||||
let mut field_cursor = FieldCursor::default();
|
||||
let mut object = json::value::Value::Object(Default::default());
|
||||
|
||||
for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() {
|
||||
let last_errc = err.issues.len();
|
||||
let (key, value) = parse_kv_arg(&*kvarg, err, false);
|
||||
@@ -210,37 +216,28 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => {
|
||||
request.kind = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"lease-timestamp" => {
|
||||
request.lease_timestamp = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"id" => {
|
||||
request.id = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"retry-count" => {
|
||||
request.retry_count = Some(arg_from_str(value.unwrap_or("-0"), err, "retry-count", "integer"));
|
||||
},
|
||||
"tag" => {
|
||||
request.tag = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"payload-base64" => {
|
||||
request.payload_base64 = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"queue-name" => {
|
||||
request.queue_name = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"enqueue-timestamp" => {
|
||||
request.enqueue_timestamp = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["enqueue-timestamp", "id", "kind", "lease-timestamp", "payload-base64", "queue-name", "retry-count", "tag"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
}
|
||||
|
||||
let type_info =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"lease-timestamp" => Some(("leaseTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"retry-count" => Some(("retry_count", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"tag" => Some(("tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"payload-base64" => Some(("payloadBase64", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"queue-name" => Some(("queueName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"enqueue-timestamp" => Some(("enqueueTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["enqueue-timestamp", "id", "kind", "lease-timestamp", "payload-base64", "queue-name", "retry-count", "tag"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
};
|
||||
if let Some((field_cursor_str, type_info)) = type_info {
|
||||
FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor);
|
||||
}
|
||||
}
|
||||
let mut request: api::Task = json::value::from_value(object).unwrap();
|
||||
let mut call = self.hub.tasks().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("taskqueue").unwrap_or(""));
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
let (key, value) = parse_kv_arg(&*parg, err, false);
|
||||
@@ -255,9 +252,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &[]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend([].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +281,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -313,9 +312,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &["group-by-tag", "tag"]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend(["group-by-tag", "tag"].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,7 +341,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -363,9 +364,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &[]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend([].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,7 +393,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -400,8 +403,9 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
fn _tasks_patch(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
let mut request = api::Task::default();
|
||||
let mut field_cursor = FieldCursor::default();
|
||||
let mut object = json::value::Value::Object(Default::default());
|
||||
|
||||
for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() {
|
||||
let last_errc = err.issues.len();
|
||||
let (key, value) = parse_kv_arg(&*kvarg, err, false);
|
||||
@@ -416,37 +420,28 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => {
|
||||
request.kind = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"lease-timestamp" => {
|
||||
request.lease_timestamp = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"id" => {
|
||||
request.id = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"retry-count" => {
|
||||
request.retry_count = Some(arg_from_str(value.unwrap_or("-0"), err, "retry-count", "integer"));
|
||||
},
|
||||
"tag" => {
|
||||
request.tag = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"payload-base64" => {
|
||||
request.payload_base64 = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"queue-name" => {
|
||||
request.queue_name = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"enqueue-timestamp" => {
|
||||
request.enqueue_timestamp = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["enqueue-timestamp", "id", "kind", "lease-timestamp", "payload-base64", "queue-name", "retry-count", "tag"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
}
|
||||
|
||||
let type_info =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"lease-timestamp" => Some(("leaseTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"retry-count" => Some(("retry_count", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"tag" => Some(("tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"payload-base64" => Some(("payloadBase64", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"queue-name" => Some(("queueName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"enqueue-timestamp" => Some(("enqueueTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["enqueue-timestamp", "id", "kind", "lease-timestamp", "payload-base64", "queue-name", "retry-count", "tag"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
};
|
||||
if let Some((field_cursor_str, type_info)) = type_info {
|
||||
FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor);
|
||||
}
|
||||
}
|
||||
let mut request: api::Task = json::value::from_value(object).unwrap();
|
||||
let new_lease_seconds: i32 = arg_from_str(&opt.value_of("new-lease-seconds").unwrap_or(""), err, "<new-lease-seconds>", "integer");
|
||||
let mut call = self.hub.tasks().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("taskqueue").unwrap_or(""), opt.value_of("task").unwrap_or(""), new_lease_seconds);
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
@@ -462,9 +457,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &[]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend([].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,7 +486,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -499,8 +496,9 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
fn _tasks_update(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
|
||||
-> Result<(), DoitError> {
|
||||
|
||||
let mut request = api::Task::default();
|
||||
let mut field_cursor = FieldCursor::default();
|
||||
let mut object = json::value::Value::Object(Default::default());
|
||||
|
||||
for kvarg in opt.values_of("kv").unwrap_or(Vec::new()).iter() {
|
||||
let last_errc = err.issues.len();
|
||||
let (key, value) = parse_kv_arg(&*kvarg, err, false);
|
||||
@@ -515,37 +513,28 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => {
|
||||
request.kind = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"lease-timestamp" => {
|
||||
request.lease_timestamp = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"id" => {
|
||||
request.id = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"retry-count" => {
|
||||
request.retry_count = Some(arg_from_str(value.unwrap_or("-0"), err, "retry-count", "integer"));
|
||||
},
|
||||
"tag" => {
|
||||
request.tag = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"payload-base64" => {
|
||||
request.payload_base64 = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"queue-name" => {
|
||||
request.queue_name = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
"enqueue-timestamp" => {
|
||||
request.enqueue_timestamp = Some(value.unwrap_or("").to_string());
|
||||
},
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["enqueue-timestamp", "id", "kind", "lease-timestamp", "payload-base64", "queue-name", "retry-count", "tag"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
}
|
||||
|
||||
let type_info =
|
||||
match &temp_cursor.to_string()[..] {
|
||||
"kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"lease-timestamp" => Some(("leaseTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"retry-count" => Some(("retry_count", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })),
|
||||
"tag" => Some(("tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"payload-base64" => Some(("payloadBase64", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"queue-name" => Some(("queueName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
"enqueue-timestamp" => Some(("enqueueTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
|
||||
_ => {
|
||||
let suggestion = FieldCursor::did_you_mean(key, &vec!["enqueue-timestamp", "id", "kind", "lease-timestamp", "payload-base64", "queue-name", "retry-count", "tag"]);
|
||||
err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string()))));
|
||||
None
|
||||
}
|
||||
};
|
||||
if let Some((field_cursor_str, type_info)) = type_info {
|
||||
FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor);
|
||||
}
|
||||
}
|
||||
let mut request: api::Task = json::value::from_value(object).unwrap();
|
||||
let new_lease_seconds: i32 = arg_from_str(&opt.value_of("new-lease-seconds").unwrap_or(""), err, "<new-lease-seconds>", "integer");
|
||||
let mut call = self.hub.tasks().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("taskqueue").unwrap_or(""), opt.value_of("task").unwrap_or(""), new_lease_seconds);
|
||||
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
|
||||
@@ -561,9 +550,11 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
Vec::new() + &self.gp + &[]
|
||||
));
|
||||
err.issues.push(CLIError::UnknownParameter(key.to_string(),
|
||||
{let mut v = Vec::new();
|
||||
v.extend(self.gp.iter().map(|v|*v));
|
||||
v.extend([].iter().map(|v|*v));
|
||||
v } ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,7 +579,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
Ok((mut response, output_schema)) => {
|
||||
let mut value = json::value::to_value(&output_schema);
|
||||
remove_json_null_values(&mut value);
|
||||
serde::json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
json::to_writer_pretty(&mut ostream, &value).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -720,6 +711,7 @@ impl<'n, 'a> Engine<'n, 'a> {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut exit_status = 0i32;
|
||||
let arg_data = [
|
||||
("taskqueues", "methods: 'get'", vec![
|
||||
("get",
|
||||
@@ -1015,7 +1007,7 @@ fn main() {
|
||||
|
||||
let mut app = App::new("taskqueue1-beta2")
|
||||
.author("Sebastian Thiel <byronimo@gmail.com>")
|
||||
.version("0.2.0+20141111")
|
||||
.version("0.3.0+20141111")
|
||||
.about("Lets you access a Google App Engine Pull Task Queue over REST.")
|
||||
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_taskqueue1_beta2_cli")
|
||||
.arg(Arg::with_name("url")
|
||||
@@ -1056,7 +1048,8 @@ fn main() {
|
||||
(_ , &Some(f)) => f,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let mut arg = Arg::with_name(arg_name_str);
|
||||
let mut arg = Arg::with_name(arg_name_str)
|
||||
.empty_values(false);
|
||||
if let &Some(short_flag) = flag {
|
||||
arg = arg.short(short_flag);
|
||||
}
|
||||
@@ -1084,12 +1077,12 @@ fn main() {
|
||||
let debug = matches.is_present("debug");
|
||||
match Engine::new(matches) {
|
||||
Err(err) => {
|
||||
env::set_exit_status(err.exit_code);
|
||||
exit_status = err.exit_code;
|
||||
writeln!(io::stderr(), "{}", err).ok();
|
||||
},
|
||||
Ok(engine) => {
|
||||
if let Err(doit_err) = engine.doit() {
|
||||
env::set_exit_status(1);
|
||||
exit_status = 1;
|
||||
match doit_err {
|
||||
DoitError::IoError(path, err) => {
|
||||
writeln!(io::stderr(), "Failed to open output file '{}': {}", path, err).ok();
|
||||
@@ -1105,4 +1098,6 @@ fn main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::process::exit(exit_status);
|
||||
}
|
||||
Reference in New Issue
Block a user