Be smarter about partial file name matches #18

Closed
opened 4 years ago 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.
jab2870 closed this issue 4 years ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: jab2870/knowledge-base#18
Loading…
There is no content yet.