hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/gils/wc.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/wc.rv
parent5f6deca073728d0dafa2cd47d841b28d54af3aaf (diff)
feat: colors + better ps1
Diffstat (limited to 'gils/wc.rv')
-rw-r--r--gils/wc.rv4
1 files changed, 2 insertions, 2 deletions
diff --git a/gils/wc.rv b/gils/wc.rv
index 9a184ca..1127299 100644
--- a/gils/wc.rv
+++ b/gils/wc.rv
@@ -1,11 +1,11 @@
# word count
const context = env.ctx
-if context.argv:len() < 2 do puts("usage: wc <path>\n") end
+if context.argv:len() < 2 do fail("usage: wc <path>\n") end
else do
const path = expand_path(context.argv[1])
const size = fs:size(path)
- if size < 0 do puts("wc: #{path}: no such file\n") end
+ if size < 0 do fail("wc: #{path}: no such file\n") end
else do
const contents = if size > 0 fs:read_bytes(path, 0, size) else ""
let line_count = 0