pimterry / notes

:pencil: Simple delightful note taking, with more unix and less lock-in.
https://github.com/pimterry/notes
MIT License
1.24k stars 82 forks source link

Notes mv #79

Closed Escyll closed 3 years ago

Escyll commented 3 years ago

A nice feature would be the ability to move notes (to other folder or renaming the file).

Syntax could be: notes mv MyWorkTodos.md Todo/Work.md or notes mv MyWorkTodos Todo/Work

The latter (without the extensions) would be inline with the other commands.

Escyll commented 3 years ago

I am willing to fork the repo and start implementing myself, however, I would first like to know if this feature has a change of being 'accepted' (the proposal itself, not the implementation of course (since there is none yet)).

pimterry commented 3 years ago

Hi @Escyll, that sounds great to me! I'm definitely open to a PR like that.

For syntax, for most (all?) other commands, we try to support both filename formats, basically making the configured file extension optional. I think that means the first argument would be used as-is, if an exactly matching filename exists (as in your first example), or we'd append the extension automatically if not (your second example). The second argument I imagine would match an exactly matching folder if that exists, and then place the source file into the folder like mv does in general, or append the extension to the argument if not, if the name doesn't already have an extension.

So, as examples:

Does that make sense?

Escyll commented 3 years ago

Yup, I totally agree. Probably I can find some time this week to implement this feature.

Escyll commented 3 years ago

Implemented as discussed.