Browse Source

rename to auto-tagger and cleanup of files

Ingolf Wagner 7 months ago
parent
commit
3b5fec9c91
4 changed files with 16 additions and 8 deletions
  1. 13 5
      README.md
  2. 3 3
      src/main.rs
  3. 0 0
      test-data/auto-tagger/invalid-tag-map.json
  4. 0 0
      test-data/auto-tagger/valid-tag-map.json

+ 13 - 5
README.md

@@ -1,14 +1,20 @@
+# How to install
 
-## AutoTagger
+to install all binaries in `~/.cargo/bin` run.
 
-> under development
+```
+cargo install --path .
+```
+
+
+## auto-tagger 
 
 automatic adds tags by parsing the description.
 
 ### How to run
 
 ```sh
-cargo run ./test-data/AutoTagger/valid-tag-map.json
+auto-tagger ./test-data/AutoTagger/valid-tag-map.json
 ```
 
 ### How to use
@@ -18,7 +24,8 @@ cargo run ./test-data/AutoTagger/valid-tag-map.json
 To use for on-add 
 
 ```sh
-AutoTagger <path/to/tag-map.json>
+#!/usr/bin/env bash
+~/.cargo/bin/auto-tagger <path/to/tag-map.json>
 ```
 
 #### on-modify
@@ -26,8 +33,9 @@ AutoTagger <path/to/tag-map.json>
 to use for on-modify (just drop the original line)
 
 ```sh
+#!/usr/bin/env bash
 read line
-AutoTagger <path/to/tag-map.json>
+~/.cargo/bin/auto-tagger <path/to/tag-map.json>
 ```
 
 # Tests

+ 3 - 3
src/main.rs

@@ -18,7 +18,7 @@ type Tags = Vec<Tag>;
 fn useage() {
     println!(
         r#"
-AutoTagger <path-to-tag-map>
+auto-tagger <path-to-tag-map>
 "#
     );
 }
@@ -189,10 +189,10 @@ mod tests {
             },
         ];
         assert_eq!(
-            get_tag_map("./test-data/AutoTagger/valid-tag-map.json").unwrap(),
+            get_tag_map("./test-data/auto-tagger/valid-tag-map.json").unwrap(),
             tag_map
         );
 
-        assert!(get_tag_map("./test-data/AutoTagger/invalid-tag-map.json").is_err());
+        assert!(get_tag_map("./test-data/auto-tagger/invalid-tag-map.json").is_err());
     }
 }

test-data/AutoTagger/invalid-tag-map.json → test-data/auto-tagger/invalid-tag-map.json


test-data/AutoTagger/valid-tag-map.json → test-data/auto-tagger/valid-tag-map.json