Closed Canop closed 5 months ago
Thanks so much!
In my first tests, this seems almost working right, but for some reason the following verb does not quit broot. If I call the verb then manually quit it does seem to work as intended though.
{
key: alt-enter
invocation: cd
internal: ":write_output {directory}"
leave_broot: true
}
Today, internals don't even check the leave_broot
setting of the verb. For most of them, quitting would be totally unexpected (think for example about "line_down", or "open_preview").
That's why my example in the PR description had an explicit :quit
.
Maybe some internals could check it ?
I've been using :print_path
with leave_broot: true
, but I guess leaving broot is part of that internal's behavior anyway? Haven't tried it with false
...
OK yeah I'll make it a cmd with quit, thanks!
Maybe an interesting quoting issue?
{
key: alt-enter
invocation: cd
cmd: ":write_output {directory};:quit"
}
No verb matches "quit\""
This works for me
Oh, I tried to use it on a folder named
with " a quote and spaces
Also happens with a folder named just sp ac
Ok... I suspected there was a bug in sequence interpolation... back to draft mode!
@AndydeCleyre back to testable
This seems to be working great with my weird folder names, thanks!
Thanks @AndydeCleyre for the review
Fix: #825
Add a
--verb-output
launch argument which takes a path to a file (which will be created if necessary)Add a
:write_output
internal which allows adding a line to that file. No escaping is done (contrary to what happens with--outcmd
).Add a
:clear_output
internal which clears the file.Here are 2 examples of verbs:
The first one is called with an input like
:wc hop
which appends to the output a line likewc:hop main.bro
.The second one makes the content of the output file the directory closest to the selection then quits. It could for example be used for a new version of the
br
shell function.Note: Semantics isn't pretty. If you have a better idea than "output", please tell me.