| 82 | } |
| 83 | |
| 84 | fn create_app() -> App<'static, 'static> { |
| 85 | let verbose_arg = Arg::with_name("verbose") |
| 86 | .short("v") |
| 87 | .multiple(true) |
| 88 | .help("Print the output of the script compilation"); |
| 89 | let recompile_arg = Arg::with_name("recompile") |
| 90 | .short("r") |
| 91 | .long("recompile") |
| 92 | .help("Force the script to be compiled, even if it is already in the cache"); |
| 93 | let no_run_arg = Arg::with_name("no_run") |
| 94 | .short("n") |
| 95 | .long("no-run") |
| 96 | .help("Don't run the script, only compile it. Add --recompile to compile even if it is \ |
| 97 | in the cache."); |
| 98 | let script_path_arg = Arg::with_name("script_path").index(1).required(true); |
| 99 | let script_args_arg = Arg::with_name("script_args").index(2).multiple(true); |
| 100 | App::new(env!("CARGO_PKG_NAME")) |
| 101 | .author(crate_authors!()) |
| 102 | .version(crate_version!()) |
| 103 | .settings(&[AppSettings::TrailingVarArg]) |
| 104 | .arg(verbose_arg) |
| 105 | .arg(recompile_arg) |
| 106 | .arg(no_run_arg) |
| 107 | .arg(script_path_arg) |
| 108 | .arg(script_args_arg) |
| 109 | } |