summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-01-01 20:05:58 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-01-01 20:07:53 +0100
commit7597551609cc6e10b6f8af3c899249c8a006963a (patch)
tree28c5f4fe8ea0b95d0413c609925e3eb4822e373d
parent24342c37ec2c6826e0d8b18b38f6ea4383178419 (diff)
-rw-r--r--bin/core/imag-ref/src/lib.rs7
-rw-r--r--bin/core/imag-ref/src/ui.rs19
2 files changed, 26 insertions, 0 deletions
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;