From 7597551609cc6e10b6f8af3c899249c8a006963a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 1 Jan 2020 20:05:58 +0100 Subject: WIP --- bin/core/imag-ref/src/lib.rs | 7 +++++++ bin/core/imag-ref/src/ui.rs | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/bin/core/imag-ref/src/lib.rs b/bin/core/imag-ref/src/lib.rs index bc41110f..22a096bd 100644 --- a/bin/core/imag-ref/src/lib.rs +++ b/bin/core/imag-ref/src/lib.rs @@ -76,6 +76,7 @@ impl ImagApplication for ImagRef { "create" => create(&rt), "remove" => remove(&rt), "list-dead" => list_dead(&rt), + "move" => do_move(&rt), other => { debug!("Unknown command"); if rt.handle_unknown_subcommand("imag-ref", other, rt.cli())?.success() { @@ -208,6 +209,12 @@ fn list_dead(rt: &Runtime) -> Result<()> { .collect() } +fn do_move(rt: &Runtime) -> Result<()> { + let cfg = get_ref_config(&rt, "imag-ref")?; + let cmd = rt.cli().subcommand_matches("move").unwrap(); // safe by main() + +} + fn create(_rt: &Runtime) -> Result<()> { unimplemented!() } diff --git a/bin/core/imag-ref/src/ui.rs b/bin/core/imag-ref/src/ui.rs index 2b548074..3583a4e5 100644 --- a/bin/core/imag-ref/src/ui.rs +++ b/bin/core/imag-ref/src/ui.rs @@ -129,6 +129,25 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .help("List ids of entries which refer to a path that does not exist")) ) + .subcommand(SubCommand::with_name("move") + .about("Move a reference (move the actual file and correct the ref in the store)") + .version("0.1") + .arg(Arg::with_name("ID") + .index(1) + .takes_value(true) + .required(false) + .multiple(false) + .help("Move this ID") + .value_name("ID")) + + .arg(Arg::with_name("target-path") + .index(2) + .takes_value(true) + .required(false) + .multiple(false) + .help("Move the file (whereever it is) to this path")) + ) + } pub struct PathProvider; -- cgit v1.2.3