chore(code): updated to latest state

This commit is contained in:
Sebastian Thiel
2016-01-30 14:08:25 +01:00
parent 5cba22f0c6
commit 75076acf16
1164 changed files with 241839 additions and 123033 deletions

View File

@@ -20,7 +20,7 @@ use clap::{App, SubCommand, Arg};
mod cmn;
use cmn::{InvalidOptionsError, CLIError, JsonTokenStorage, arg_from_str, writer_from_opts, parse_kv_arg,
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, ComplexType, JsonType, JsonTypeInfo};
@@ -36,22 +36,22 @@ enum DoitError {
ApiError(api::Error),
}
struct Engine<'n, 'a> {
opt: ArgMatches<'n, 'a>,
struct Engine<'n> {
opt: ArgMatches<'n>,
hub: api::Webmasters<hyper::Client, Authenticator<DefaultAuthenticatorDelegate, JsonTokenStorage, hyper::Client>>,
gp: Vec<&'static str>,
gpm: Vec<(&'static str, &'static str)>,
}
impl<'n, 'a> Engine<'n, 'a> {
fn _searchanalytics_query(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
impl<'n> Engine<'n> {
fn _searchanalytics_query(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
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() {
for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let last_errc = err.issues.len();
let (key, value) = parse_kv_arg(&*kvarg, err, false);
let mut temp_cursor = field_cursor.clone();
@@ -65,8 +65,8 @@ impl<'n, 'a> Engine<'n, 'a> {
}
continue;
}
let type_info: Option<(&'static str, JsonTypeInfo)> =
let type_info: Option<(&'static str, JsonTypeInfo)> =
match &temp_cursor.to_string()[..] {
"start-date" => Some(("startDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
"end-date" => Some(("endDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })),
@@ -86,7 +86,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
let mut request: api::SearchAnalyticsQueryRequest = json::value::from_value(object).unwrap();
let mut call = self.hub.searchanalytics().query(request, opt.value_of("site-url").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -99,7 +99,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -112,7 +112,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -135,10 +135,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sitemaps_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sitemaps_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sitemaps().delete(opt.value_of("site-url").unwrap_or(""), opt.value_of("feedpath").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -151,7 +151,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -164,7 +164,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
match match protocol {
@@ -179,10 +179,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sitemaps_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sitemaps_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sitemaps().get(opt.value_of("site-url").unwrap_or(""), opt.value_of("feedpath").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -195,7 +195,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -208,7 +208,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -231,10 +231,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sitemaps_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sitemaps_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sitemaps().list(opt.value_of("site-url").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
"sitemap-index" => {
@@ -250,7 +250,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v.extend(["sitemap-index"].iter().map(|v|*v));
@@ -264,7 +264,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -287,10 +287,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sitemaps_submit(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sitemaps_submit(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sitemaps().submit(opt.value_of("site-url").unwrap_or(""), opt.value_of("feedpath").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -303,7 +303,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -316,7 +316,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
match match protocol {
@@ -331,10 +331,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sites_add(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sites_add(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sites().add(opt.value_of("site-url").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -347,7 +347,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -360,7 +360,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
match match protocol {
@@ -375,10 +375,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sites_delete(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sites_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sites().delete(opt.value_of("site-url").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -391,7 +391,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -404,7 +404,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
match match protocol {
@@ -419,10 +419,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sites_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sites_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sites().get(opt.value_of("site-url").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -435,7 +435,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -448,7 +448,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -471,10 +471,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _sites_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _sites_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.sites().list();
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -487,7 +487,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -500,7 +500,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -523,10 +523,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _urlcrawlerrorscounts_query(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _urlcrawlerrorscounts_query(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.urlcrawlerrorscounts().query(opt.value_of("site-url").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
"platform" => {
@@ -548,7 +548,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v.extend(["category", "platform", "latest-counts-only"].iter().map(|v|*v));
@@ -562,7 +562,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -585,10 +585,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _urlcrawlerrorssamples_get(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _urlcrawlerrorssamples_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.urlcrawlerrorssamples().get(opt.value_of("site-url").unwrap_or(""), opt.value_of("url").unwrap_or(""), opt.value_of("category").unwrap_or(""), opt.value_of("platform").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -601,7 +601,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -614,7 +614,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -637,10 +637,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _urlcrawlerrorssamples_list(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _urlcrawlerrorssamples_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.urlcrawlerrorssamples().list(opt.value_of("site-url").unwrap_or(""), opt.value_of("category").unwrap_or(""), opt.value_of("platform").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -653,7 +653,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -666,7 +666,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
let mut ostream = match writer_from_opts(opt.value_of("out")) {
@@ -689,10 +689,10 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
fn _urlcrawlerrorssamples_mark_as_fixed(&self, opt: &ArgMatches<'n, 'a>, dry_run: bool, err: &mut InvalidOptionsError)
fn _urlcrawlerrorssamples_mark_as_fixed(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError)
-> Result<(), DoitError> {
let mut call = self.hub.urlcrawlerrorssamples().mark_as_fixed(opt.value_of("site-url").unwrap_or(""), opt.value_of("url").unwrap_or(""), opt.value_of("category").unwrap_or(""), opt.value_of("platform").unwrap_or(""));
for parg in opt.values_of("v").unwrap_or(Vec::new()).iter() {
for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
let (key, value) = parse_kv_arg(&*parg, err, false);
match key {
_ => {
@@ -705,7 +705,7 @@ impl<'n, 'a> Engine<'n, 'a> {
}
}
if !found {
err.issues.push(CLIError::UnknownParameter(key.to_string(),
err.issues.push(CLIError::UnknownParameter(key.to_string(),
{let mut v = Vec::new();
v.extend(self.gp.iter().map(|v|*v));
v } ));
@@ -718,7 +718,7 @@ impl<'n, 'a> Engine<'n, 'a> {
Ok(())
} else {
assert!(err.issues.len() == 0);
for scope in self.opt.values_of("url").unwrap_or(Vec::new()).iter() {
for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() {
call = call.add_scope(scope);
}
match match protocol {
@@ -834,14 +834,14 @@ impl<'n, 'a> Engine<'n, 'a> {
}
// Please note that this call will fail if any part of the opt can't be handled
fn new(opt: ArgMatches<'a, 'n>) -> Result<Engine<'a, 'n>, InvalidOptionsError> {
fn new(opt: ArgMatches<'n>) -> Result<Engine<'n>, InvalidOptionsError> {
let (config_dir, secret) = {
let config_dir = match cmn::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) {
Err(e) => return Err(InvalidOptionsError::single(e, 3)),
Ok(p) => p,
};
match cmn::application_secret_from_directory(&config_dir, "webmasters3-secret.json",
match cmn::application_secret_from_directory(&config_dir, "webmasters3-secret.json",
"{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") {
Ok(secret) => (config_dir, secret),
Err(e) => return Err(InvalidOptionsError::single(e, 4))
@@ -861,7 +861,7 @@ impl<'n, 'a> Engine<'n, 'a> {
db_dir: config_dir.clone(),
}, None);
let client =
let client =
if opt.is_present("debug") {
hyper::Client::with_connector(mock::TeeConnector {
connector: hyper::net::HttpsConnector::<hyper::net::Openssl>::default()
@@ -900,7 +900,7 @@ fn main() {
let mut exit_status = 0i32;
let arg_data = [
("searchanalytics", "methods: 'query'", vec![
("query",
("query",
Some(r##"Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days.
When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned."##),
@@ -933,7 +933,7 @@ fn main() {
]),
("sitemaps", "methods: 'delete', 'get', 'list' and 'submit'", vec![
("delete",
("delete",
Some(r##"Deletes a sitemap from this site."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sitemaps_delete",
vec![
@@ -955,7 +955,7 @@ fn main() {
Some(false),
Some(true)),
]),
("get",
("get",
Some(r##"Retrieves information about a specific sitemap."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sitemaps_get",
vec![
@@ -983,7 +983,7 @@ fn main() {
Some(false),
Some(false)),
]),
("list",
("list",
Some(r##"Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request)."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sitemaps_list",
vec![
@@ -1005,7 +1005,7 @@ fn main() {
Some(false),
Some(false)),
]),
("submit",
("submit",
Some(r##"Submits a sitemap for a site."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sitemaps_submit",
vec![
@@ -1030,8 +1030,8 @@ fn main() {
]),
("sites", "methods: 'add', 'delete', 'get' and 'list'", vec![
("add",
Some(r##"Adds a site to the set of the user's sites in Webmaster Tools."##),
("add",
Some(r##"Adds a site to the set of the user's sites in Search Console."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sites_add",
vec![
(Some(r##"site-url"##),
@@ -1046,8 +1046,8 @@ fn main() {
Some(false),
Some(true)),
]),
("delete",
Some(r##"Removes a site from the set of the user's Webmaster Tools sites."##),
("delete",
Some(r##"Removes a site from the set of the user's Search Console sites."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sites_delete",
vec![
(Some(r##"site-url"##),
@@ -1062,7 +1062,7 @@ fn main() {
Some(false),
Some(true)),
]),
("get",
("get",
Some(r##"Retrieves information about specific site."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sites_get",
vec![
@@ -1084,8 +1084,8 @@ fn main() {
Some(false),
Some(false)),
]),
("list",
Some(r##"Lists the user's Webmaster Tools sites."##),
("list",
Some(r##"Lists the user's Search Console sites."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/sites_list",
vec![
(Some(r##"v"##),
@@ -1103,7 +1103,7 @@ fn main() {
]),
("urlcrawlerrorscounts", "methods: 'query'", vec![
("query",
("query",
Some(r##"Retrieves a time series of the number of URL crawl errors per error category and platform."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/urlcrawlerrorscounts_query",
vec![
@@ -1128,7 +1128,7 @@ fn main() {
]),
("urlcrawlerrorssamples", "methods: 'get', 'list' and 'mark-as-fixed'", vec![
("get",
("get",
Some(r##"Retrieves details about crawl errors for a site's sample URL."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/urlcrawlerrorssamples_get",
vec![
@@ -1168,7 +1168,7 @@ fn main() {
Some(false),
Some(false)),
]),
("list",
("list",
Some(r##"Lists a site's sample URLs for the specified crawl error category and platform."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/urlcrawlerrorssamples_list",
vec![
@@ -1202,7 +1202,7 @@ fn main() {
Some(false),
Some(false)),
]),
("mark-as-fixed",
("mark-as-fixed",
Some(r##"Marks the provided site's sample URL as fixed, and removes it from the samples list."##),
"Details at http://byron.github.io/google-apis-rs/google_webmasters3_cli/urlcrawlerrorssamples_mark-as-fixed",
vec![
@@ -1242,8 +1242,8 @@ fn main() {
let mut app = App::new("webmasters3")
.author("Sebastian Thiel <byronimo@gmail.com>")
.version("0.3.2+20150804")
.about("Lets you view Google Webmaster Tools data for your verified sites.")
.version("0.3.3+20151229")
.about("Lets you view Google Search Console data for your verified sites.")
.after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webmasters3_cli")
.arg(Arg::with_name("url")
.long("scope")
@@ -1266,7 +1266,7 @@ fn main() {
.multiple(false)
.takes_value(false));
for &(main_command_name, ref about, ref subcommands) in arg_data.iter() {
for &(main_command_name, about, ref subcommands) in arg_data.iter() {
let mut mcmd = SubCommand::with_name(main_command_name).about(about);
for &(sub_command_name, ref desc, url_info, ref args) in subcommands {
@@ -1277,7 +1277,7 @@ fn main() {
scmd = scmd.after_help(url_info);
for &(ref arg_name, ref flag, ref desc, ref required, ref multi) in args {
let arg_name_str =
let arg_name_str =
match (arg_name, flag) {
(&Some(an), _ ) => an,
(_ , &Some(f)) => f,