mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-18 17:30:03 +01:00
fix(clap): call iter() directly
As IntoIter is only implemented for slices up a sice of 32. DFAReporting though will reach 55, at least. Also added dfareporting-cli code to show how stackoverflow issues can be circumvented efficiently.
This commit is contained in:
@@ -214,7 +214,7 @@ This documentation was generated from the *dfareporting* API at revision *201503
|
||||
dfareporting2d1 --help
|
||||
|
||||
All documentation details can be found at
|
||||
http://byron.github.io/google-apis-rs/google_dfareporting2d1_cli/index.html
|
||||
http://byron.github.io/google-apis-rs/google_dfareporting2d1_cli
|
||||
|
||||
Configuration:
|
||||
--scope <url>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token};
|
||||
use rustc_serialize::json;
|
||||
use mime::Mime;
|
||||
use clap::{App, SubCommand};
|
||||
|
||||
use std::fs;
|
||||
use std::env;
|
||||
@@ -17,6 +18,22 @@ use std::default::Default;
|
||||
|
||||
const FIELD_SEP: char = '.';
|
||||
|
||||
/// Unused for now, can be used once https://github.com/kbknapp/clap-rs/issues/87
|
||||
/// is available
|
||||
pub enum UploadProtocol {
|
||||
Simple,
|
||||
Resumable,
|
||||
}
|
||||
|
||||
impl AsRef<str> for UploadProtocol {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
UploadProtocol::Simple => "simple",
|
||||
UploadProtocol::Resumable => "resumable",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct FieldCursor(Vec<String>);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
||||
<%namespace name="util" file="../../lib/util.mako"/>\
|
||||
<%!
|
||||
import os
|
||||
|
||||
from util import (put_and, supports_scopes, api_index, indent_by, enclose_in)
|
||||
from cli import (mangle_subcommand, new_method_context, PARAM_FLAG, STRUCT_FLAG, UPLOAD_FLAG, OUTPUT_FLAG, VALUE_ARG,
|
||||
CONFIG_DIR, SCOPE_FLAG, is_request_value_property, FIELD_SEP, docopt_mode, FILE_ARG, MIME_ARG, OUT_ARG,
|
||||
@@ -56,7 +58,7 @@
|
||||
${util.program_name()} --help
|
||||
|
||||
All documentation details can be found at
|
||||
${cargo.doc_base_url + '/' + api_index(cargo.doc_base_url, name, version, make, check_exists=False)}
|
||||
${cargo.doc_base_url + '/' + os.path.dirname(api_index(cargo.doc_base_url, name, version, make, check_exists=False))}
|
||||
|
||||
Configuration:
|
||||
% if supports_scopes(auth):
|
||||
@@ -81,8 +83,8 @@ Configuration:
|
||||
|
||||
<%def name="new(c)" buffered="True">\
|
||||
<%
|
||||
url_info = "All documentation details can be found at" + \
|
||||
cargo.doc_base_url + '/' + api_index(cargo.doc_base_url, name, version, make, check_exists=False)
|
||||
url_info = "All documentation details can be found at " + \
|
||||
cargo.doc_base_url + '/' + os.path.dirname(api_index(cargo.doc_base_url, name, version, make, check_exists=False))
|
||||
|
||||
# list of tuples
|
||||
# (0) = long name
|
||||
@@ -235,7 +237,7 @@ let arg_data = [
|
||||
% endfor # end for each resource
|
||||
];
|
||||
|
||||
for &(main_command_name, ref subcommands) in &arg_data {
|
||||
for &(main_command_name, ref subcommands) in arg_data.iter() {
|
||||
let mut mcmd = SubCommand::new(main_command_name);
|
||||
for &(sub_command_name, ref desc, ref args) in subcommands {
|
||||
let mut scmd = SubCommand::new(sub_command_name);
|
||||
|
||||
Reference in New Issue
Block a user