-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
:write_output & :clear_output, --verb_output #834
Conversation
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 That's why my example in the PR description had an explicit Maybe some internals could check it ? |
I've been using 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"
}
|
This works for me |
Oh, I tried to use it on a folder named
|
Also happens with a folder named just |
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.