summaryrefslogtreecommitdiff
path: root/src/verbs.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/verbs.zig')
-rw-r--r--src/verbs.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/verbs.zig b/src/verbs.zig
index c9174d3..722a0c2 100644
--- a/src/verbs.zig
+++ b/src/verbs.zig
@@ -31,7 +31,7 @@ pub const usage =
\\ fs read PATH the file, to its end (a held read streams)
\\ fs write PATH [WORDS...] the words and a newline, else stdin, as > would
\\ fs ask PATH WORDS... write the words and read the answer on the same open
- \\ fs follow PATH [WORDS...] ask, or read: what comes, as it comes
+ \\ fs follow PATH [WORDS...] ask, or read: what comes, as it comes, for as long
\\ fs stat PATH mode length uid gid mtime name
\\ fs help [PATH] what the tree's README says of PATH
\\ fs complete [PREFIX] the paths that go on from PREFIX, for a shell
@@ -49,6 +49,7 @@ pub fn run(f: *Fsys, args: []const []const u8, in: *Io.Reader, out: *Io.Writer,
error.Refused => err.print("fs: {s}: {s}\n", .{ path, f.said() }),
error.Hangup => err.print("fs: {s}: the server hung up\n", .{path}),
error.Botch => err.print("fs: {s}: protocol botch\n", .{path}),
+ error.Timeout => err.print("fs: {s}: no answer in {d} ms; fs follow waits for ever\n", .{ path, if (f.timeout.toDurationFromNow(f.io)) |d| d.raw.toMilliseconds() else 0 }),
error.Usage => err.writeAll(usage),
error.TooLong => err.print("fs: {s}: the words are longer than a message\n", .{path}),
// Our own stdin or stdout: nothing to say it on.
@@ -106,6 +107,7 @@ fn runVerb(f: *Fsys, args: []const []const u8, in: *Io.Reader, out: *Io.Writer,
},
.follow => {
if (args.len < 2) return error.Usage;
+ f.timeout = .none;
if (words.len == 0) try f.readFile(path, out) else try f.ask(path, try line(&line_buf, words), out);
},
.stat => {