hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/gils/head.rv
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-08 11:50:02 +0200
committerhachem <im@hachem.wtf>2026-10-08 11:50:02 +0200
commitef104148057ab98f80b1560405b5c02768457096 (patch)
tree47e75bc81aacb2e035e7cd43be9616b677b01d04 /gils/head.rv
parent5f6deca073728d0dafa2cd47d841b28d54af3aaf (diff)
feat: colors + better ps1
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