From 9866cbc87dc45fb4081f18ff59381743c0e9fe8d Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 23 May 2023 00:27:00 +0200 Subject: [PATCH] Updates readme for new version --- .gitignore | 3 ++- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index d9773dc..5e4e5bd 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ Cargo.lock /target /coverage /llvm -tarpaulin-report.html \ No newline at end of file +tarpaulin-report.html +!coverage/html/badges/flat.svg \ No newline at end of file diff --git a/README.md b/README.md index bdfbe18..f82dc83 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,60 @@ -# snp +# SNP : A (simple) Code Snippet Manager + ![coverage/html/badges/flat.svg](coverage/html/badges/flat.svg) drawing -A simple cli utility to manage snippets, while it was created to be used with Helix, it can work with any tool integrating input from stdout - ## Usage -```sh -To create a new snippet and edit it immediately -$ snp snippet_name -c -e list of default tokens +### Create and Edit Snippet -To edit the content of a snippet +To create a new snippet and edit its content immediately, use the following command: +``` +$ snp snippet_name -c -e list_of_default_tokens +``` +Replace `snippet_name` with the desired name for your snippet and provide a space-separated `list_of_default_tokens` that you want to include in the snippet. This command will create the snippet and open the editor for you to modify its content. + +### Edit Snippet Content + +To edit the content of an existing snippet, use the following command: +``` $ snp snippet_name -e +``` +Replace `snippet_name` with the name of the snippet you want to edit. This command will open the editor for you to modify the content of the specified snippet. -To edit the whole snippet (allow for editing of name and list of args) +### Edit Whole Snippet + +To edit the entire snippet, including its name and list of arguments, use the following command: +``` $ snp snippet_name -E +``` +Replace `snippet_name` with the name of the snippet you want to edit. This command will open the editor for you to modify the name, content, and arguments of the specified snippet. -To delete a snippet +#### Wonky Not definitive behaviour + +- If you change the name of the snippet this way, the snippet will not be saved under a different name, this behaviour will change very soon +- If you mess up in any way, the snippet manager will save your work under `snippet_name.bad.yaml` + +### Delete Snippet + +To delete a snippet, use the following command: +``` $ snp snippet_name -d +``` +Replace `snippet_name` with the name of the snippet you want to delete. This command will remove the specified snippet from the snippet folder . -To use a snippet +### Use Snippet + +To use a snippet, simply execute the following command: +``` $ snp snippet_name ``` +Replace `snippet_name` with the name of the snippet you want to use. This command will execute the specified snippet. ## Testing -For reasons too long to explain here, test must be run with the optional feature ``--feature "test"`. -Failure to do so will result in the editor popping in during tests. +For testing purposes, it is important to run tests with the optional feature `--feature "test"`. Failing to include this feature may cause the editor to pop up during tests. To run tests, use the following command: +``` +$ cargo test --feature "test" +``` +Make sure to include the `--feature "test"` option to ensure smooth testing without interruptions from the editor. +