Refactor: use App in the build_ui function of imag-init
This commit is contained in:
parent
84e1cffbe3
commit
7e9c25fd63
2 changed files with 7 additions and 7 deletions
|
@ -50,6 +50,7 @@ use std::process::Command;
|
|||
|
||||
use libimagerror::exit::ExitUnwrap;
|
||||
use libimagerror::io::ToExitCode;
|
||||
use libimagrt::runtime::Runtime;
|
||||
|
||||
const CONFIGURATION_STR : &'static str = include_str!("../imagrc.toml");
|
||||
|
||||
|
@ -68,7 +69,10 @@ imagrc.toml
|
|||
|
||||
fn main() {
|
||||
let version = make_imag_version!();
|
||||
let app = ui::build_ui(&version);
|
||||
let app = ui::build_ui(Runtime::get_default_cli_builder(
|
||||
"imag-init",
|
||||
version.as_str(),
|
||||
"Intializes the imag store, optionally with git"));
|
||||
let matches = app.get_matches();
|
||||
let mut out = ::std::io::stdout();
|
||||
|
||||
|
|
|
@ -19,12 +19,8 @@
|
|||
|
||||
use clap::{Arg, App};
|
||||
|
||||
pub fn build_ui<'a>(version: &'a str) -> App<'a, 'a> {
|
||||
App::new("imag-init")
|
||||
.version(version)
|
||||
.author("Matthias Beyer <mail@beyermatthias.de>")
|
||||
.about("Initialize a ~/.imag repository. Optionally with git")
|
||||
|
||||
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
|
||||
app
|
||||
.arg(Arg::with_name("devel")
|
||||
.long("dev")
|
||||
.takes_value(false)
|
||||
|
|
Loading…
Reference in a new issue