-
-
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
Add a --verb-output launch argument #825
Comments
Thanks! To be clear, in your example, Like a manual logger? |
Yes. |
FWIW, I happen to be using a verb with that particular name: {
invocation: write {subpath}
external: $EDITOR {directory}/{subpath}
leave_broot: false
} And I'm inclined to think of the upcoming internal as "append line" |
For a verb similar to yours, which is dedicated to creating new files, I use "create" with shortcut "cr".
|
@AndydeCleyre Did you see/test the PR ? |
No! Thanks for the work and the ping! I'll test today or tonight. |
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: ``` { invocation: "wc {cmd}" execution: ":write_output wc:{cmd} {file-stem}.bro" } { key: alt-w cmd: ":clear_output;:write_output {directory};:quit" } ``` The first one is called with an input like `:wc hop` which appends to the output a line like `wc: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.
Similar to the existing
--outcmd
, but the file whose path is given as argument would contain what the verb decides to write.The verb could for example be
:write {file}:{line}
or:write {path}
.Each time there's a write after the first one, a
\n
would be inserted.There could be several lines, for example when a verb doesn't quit broot, or when the verb is called in the staging area.
Such a file would mainly be the basis for a rewritten br shell function, which would solve some escaping problems.
Related: #824
The text was updated successfully, but these errors were encountered: