xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.43k stars 181 forks source link

nb browse add --tags does not function as described in the documentation #223

Closed ejheil closed 1 year ago

ejheil commented 1 year ago

The documentation gives this example command:

nb browse add --title "Example Title" --content "Example content." --tags tag1,tag2

with this expected output (In the browse textarea):

# Example Title                                    ]

#tag1 #tag2

Example content.  

However running that command in fact only produces:

# Example Title

Example content.

This is with nb version 7.2.0 installed via homebrew on macos.

xwmx commented 1 year ago

Thanks for the heads up! There are several passing tests for this, including:

I just looked over the code and everything appears normal so far. If possible, please try cloning the project and running bats test/browse-add.bats -f item-selector in the project root directory, sharing any error output.

ejheil commented 1 year ago

That test passes just fine, but I'm not sure how it passes! (I am not familiar with "bats".)

I see that the test looks for #tag1 and #tag2, but when I actually run the command which is present in the tests --

nb browse Example\ Folder/Example\ File.md --add --print  \
    --title     "Example Title"                                       \
    --content   "Example content."                                    \
    --tags      tag1,tag2

no tags are present in the printed HTML output.

➜  nb git:(master) nb browse Example\ Folder/Example\ File.md --add --print  \
    --title     "Example Title"                                       \
    --content   "Example content."                                    \
    --tags      tag1,tag2 \
> | grep tag
➜  nb git:(master)
xwmx commented 1 year ago

This should now be working as documented as of version 7.2.1. Let me know if you still encounter issues with it. Thanks!

ejheil commented 1 year ago

Confirmed works great, thanks!