Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ls alias for find #14

Closed
wants to merge 3 commits into from
Closed

Conversation

jacobmischka
Copy link
Contributor

@jacobmischka jacobmischka commented Dec 3, 2016

After creating a note the first thing I tried to do was run notes ls to show all of my existing ones, and was a little confused as to what command I was supposed to run instead.

While this means you can search with it as well, which isn't technically fully correct, it seems like a harmless alias.

@pimterry
Copy link
Owner

pimterry commented Dec 3, 2016

Thanks for all your contributions! Seeing people get involved like this is great.

Sadly though, I'm not going to merge this one. I do agree that an ls command will be useful and is probably a common expectation, but I don't want it to just be an alias of find (as you pointed out: it's a bit weird that ls does searches) and I'm hoping to use it as part of the route to making managing trees of notes better.

I'm imagining maybe that find would return every single matching note (probably all of them as it does now), while ls would return direct matches at the given level. E.g:

> notes find
note.md
more-notes/another-note.md
more-notes/third-note.md
more-notes/yet-another-note.md

> notes ls
note.md
more-notes/

> notes ls more-notes
another-note.md
third-note.md
yet-another-note.md

That makes ls an simple effective tool for browsing your notes, and leaves find as the go-to tool for searching them. Just spitballing here, but I think that could work nicely. Does that make sense to you?

I'm going to close this for now, but feel free to open a new PR pivoting this to match the above or try out some other approaches if you'd like.

@pimterry pimterry closed this Dec 3, 2016
@jacobmischka jacobmischka mentioned this pull request Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants