Skip to content

Instantly share code, notes, and snippets.

@gugahoa
Created July 24, 2018 20:57
Show Gist options
  • Save gugahoa/0b72eb6c4b6ddb70fb806bc95defc203 to your computer and use it in GitHub Desktop.
Save gugahoa/0b72eb6c4b6ddb70fb806bc95defc203 to your computer and use it in GitHub Desktop.
#![feature(prelude_import)]
#![no_std]
#![feature(use_extern_macros)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
extern crate thunder;
extern crate clap;
use thunder::thunderclap;
struct Wrapper;
impl Wrapper {
/// Say hello
fn hello(name: Option<&str>) {
// Expansão do macro println! escondida
}
}
#[doc = r" This block was generated by thunder v0.0.0"]
#[allow(unused)]
impl Wrapper {
#[doc =
r" Starts the CLI parsing and calls whichever function handles the input"]
fn start() {
use clap::{App, SubCommand, Arg, AppSettings};
let app =
App::new("Wrapper").about("").setting(AppSettings::SubcommandRequired).subcommand(SubCommand::with_name("hello").about("Say hello").arg(Arg::with_name("name")));
let args = app.get_matches();
let mut global_match_states =
__ThunderDataStaticStore::new_empty_store();
unsafe { __THUNDER_DATA_STATIC = Some(global_match_states); }
match args.subcommand() {
("hello", Some(m)) => Wrapper::hello(m.value_of("name")),
_ => { }
}
}
}
static mut __THUNDER_DATA_STATIC: Option<__ThunderDataStaticStore> = None;
#[doc = r" This block was generated by thunder v0.0.0"]
#[allow(unused)]
#[doc(hidden)]
struct __ThunderDataStaticStore {
}
#[allow(unused)]
#[doc(hidden)]
impl __ThunderDataStaticStore {
pub fn new_empty_store() -> __ThunderDataStaticStore {
__ThunderDataStaticStore{}
}
}
fn main() { Wrapper::start(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment