Closed Canop closed 7 months ago
Thanks! To be clear, in your example, :write
is a new internal that appends to the file specified by --verb-output
?
Like a manual logger?
Thanks! To be clear, in your example, :write is a new internal that appends to the file specified by --verb-output?
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".
append_line
wouldn't really convey the intent, which is most often to write only one path and exit.
@AndydeCleyre Did you see/test the PR ?
No! Thanks for the work and the ping!
I'll test today or tonight.
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: https://github.com/Canop/broot/issues/824