Be smarter about partial file name matches #18

Closed
opened 2020-12-29 08:41:41 +00:00 by jab2870 · 0 comments
Owner

This is best shown with an example. Here I use view although the same is true for any command that takes an existing file name like view or edit.

kb view test

This currently does looks in up to 3 places for the file:

  1. If test is an integer, it will try to find a file with that id (obviously not in this case)
  2. It will try to find a file in dataDir called test
  3. It will try to find a file in dataDir called test.md

This is ok for now while all files are markdown although it might be more useful to check the DB after determining it is not an ID.

This way, we could match a unique string.

This is best shown with an example. Here I use view although the same is true for any command that takes an existing file name like view or edit. ```bash kb view test ``` This currently does looks in up to 3 places for the file: 1. If `test` is an integer, it will try to find a file with that id (obviously not in this case) 2. It will try to find a file in dataDir called `test` 3. It will try to find a file in dataDir called `test.md` This is ok for now while all files are markdown although it might be more useful to check the DB after determining it is not an ID. This way, we could match a unique string.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jab2870/knowledge-base#18
No description provided.