mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-23 11:44:55 +01:00
fix(clap): generate command data structure
We do this in the hopes to circumvent a stack overflow. This means we will setup the parser entirely at runtime, which actually saves a little bit of code.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token};
|
||||
use rustc_serialize::json;
|
||||
use mime::Mime;
|
||||
use clap::{App, SubCommand};
|
||||
|
||||
use std::fs;
|
||||
use std::env;
|
||||
@@ -15,6 +16,22 @@ use std::default::Default;
|
||||
|
||||
const FIELD_SEP: char = '.';
|
||||
|
||||
|
||||
fn make_subcommand(command_name: &str, desc: Option<&str>,
|
||||
args: &Vec<(Option<&str>, Option<&str>, Option<&str>,
|
||||
Option<bool>, Option<bool>)>)
|
||||
-> App<'a, 'v, 'ab, 'u, 'h, 'ar> {
|
||||
// arg_name: Option<&str>,
|
||||
// short_name: Option<&str>,
|
||||
// help: Option<&str>,
|
||||
// % if flag is not None:
|
||||
// .takes_value(${rust_boolean(arg_name)})
|
||||
// required: Option<bool>,
|
||||
// multiple: Option<bool>
|
||||
SubCommand::new(command_name)
|
||||
}
|
||||
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct FieldCursor(Vec<String>);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user