hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/gils/head.rv
diff options
context:
space:
mode:
Diffstat (limited to 'gils/head.rv')
-rw-r--r--gils/head.rv4
1 files changed, 2 insertions, 2 deletions
diff --git a/gils/head.rv b/gils/head.rv
index addd11a..2c2a82f 100644
--- a/gils/head.rv
+++ b/gils/head.rv
@@ -13,13 +13,13 @@ fn file_lines(path) do
end
const context = env.ctx
-if context.argv:len() < 2 do puts("usage: head [n] <path>\n") end
+if context.argv:len() < 2 do fail("usage: head [n] <path>\n") end
else do
let limit = 10
let path_arg = context.argv[1]
if (context.argv:len() >= 3 and parse_pid(context.argv[1]) >= 0) do limit = parse_pid(context.argv[1]) path_arg = context.argv[2] end
const lines = file_lines(expand_path(path_arg))
- if lines == :nil do puts("head: no such file\n") end
+ if lines == :nil do fail("head: no such file\n") end
else do
let index = 0
while (index < lines:len() and index < limit) do puts("#{lines[index]}\n") index += 1 end