From 7e9c25fd63b169ef50a6b54e73b16b035f2fdd8d Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 11:54:56 +0200 Subject: [PATCH] Refactor: use App in the build_ui function of imag-init --- bin/core/imag-init/src/main.rs | 6 +++++- bin/core/imag-init/src/ui.rs | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/core/imag-init/src/main.rs b/bin/core/imag-init/src/main.rs index 2ad15725..de809128 100644 --- a/bin/core/imag-init/src/main.rs +++ b/bin/core/imag-init/src/main.rs @@ -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(); diff --git a/bin/core/imag-init/src/ui.rs b/bin/core/imag-init/src/ui.rs index ff985290..7936cc9b 100644 --- a/bin/core/imag-init/src/ui.rs +++ b/bin/core/imag-init/src/ui.rs @@ -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 ") - .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)