Refactor: use App in the build_ui function of imag-init

This commit is contained in:
Mario Krehl 2018-04-14 11:54:56 +02:00 committed by Matthias Beyer
parent 84e1cffbe3
commit 7e9c25fd63
2 changed files with 7 additions and 7 deletions

View file

@ -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();

View file

@ -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)