script passed through shellcheck linter
[bash-notes.git] / README.md
index b2d9f6d..88b8389 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ here's all the functions that are now available:
 -p | --plain                   : Output is in plain text (without this option the output is colored)
 -l | --list                    : List existing notes
 -a | --add "<title>"           : Add new note
--m | --modify <note>           : Modify note
+-e | --edit <note>             : Modify note
 -d | --delete [<note> | all]   : Delete note
 -v | --version                 : Print version
 --userconf                     : Export User config file
@@ -34,7 +34,7 @@ And you'll have all your settings in `~/.config/bash-notes.rc`. This file will b
 
 You can change all these settings:
 
-```Bash
+```bash
 # Binaries to use
 JQ=/usr/bin/jq
 EDITOR=/usr/bin/vim
@@ -44,6 +44,9 @@ TERMINAL=/usr/bin/alacritty
 # see example in the addnote function
 TERM_OPTS="--class notes --title notes -e "
 
+# set this to true to have output in plain text
+# or use the -p option on the command line before every other option
+PLAIN=false
 # base directory for program files
 BASEDIR=~/.local/share/bash-notes
 # notes database in json format
@@ -59,6 +62,7 @@ Special attention is needed when specifying the options, in my case, using [alac
 ### Functionalities
 
 bash-notes can:
+
  * write a new note `--add "Your note title"` or in short `-a "Your note title"`
  * modify an existing note `--edit [note ID]`, short version `-e [note ID]`
  * delete a note `--delete [note ID]`, or `-d [note ID]`
@@ -69,7 +73,7 @@ The *note id* is assigned when the note is created, and that's how you refer to
 
 The `--plain` or `-p` option in short, dictates how the output from the script is formatted, here's a sample listing of all the notes:
 
-```
+```bash
 notes.sh -l
 listing all notes
 
@@ -80,7 +84,7 @@ listing all notes
 
 And here's the same listing with the plain option:
 
-```
+```bash
 notes.sh -pl
 1 - ciao nota - 25/03/2023 18:53 +0100CET
 2 - hello there - 25/03/2023 19:02 +0100CET
@@ -91,6 +95,27 @@ The plain option must precede all other options or it won't work. I'll try and f
 
 I'd love to implement some kind of searching functionality, but I'll have to look into that.
 
+### Installing
+
+Simply copy the script in your $PATH and make it executable, something like this should work:
+
+```bash
+mv notes.sh ~/bin/
+chmod 755 ~/bin/notes.sh
+```
+
+Adapt to your needs as you see fit.
+
+### Debugging
+
+If the script doesn't work for you for some reasons, you can turn on debugging by running the script like this:
+
+```bash
+DEBUG=true notes.sh [options]
+```
+
+And then you'll be able to check all that happened in the log file at `/tmp/debug_bash-notes.log`
+
 ### Vision
 
 Ok, maybe vision is a bit of a stretch, but I've written this script to use it in my daily workflow with [rofi](https://github.com/davatorium/rofi) and [i3wm](https://github.com/i3/i3). I'll adapt the way it works to better suit this need of mine.
@@ -103,12 +128,20 @@ There are of course things I'd love to add, but my main goal is for it to work t
  * add a way to display a note without running vim
  * markdown?
        - maybe implement an export feature that builds the html file from the note
+ * write a bash completion script to enable autocomplete in the shell
  * other ideas may come [...]
 
 ### Contributing
 
 It'd mean so much to receive some feedback, patches if you feel like contributing, I'm not expecting much as this is a personal project, but feel free to interact as much as you want.
 
+### ChangeLog
+
+ * v0.2 - debugging implemented
+     - you can now generate a debug log in case something doesn't work
+ * v0.1 - first public upload
+     - all major functionalities are present and working
+
 ### Mantainer
 
  * [danix](https://danix.xyz) - it's just me, really...