diff options
| author | hachem <im@hachem.wtf> | 2026-10-08 11:50:02 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-08 11:50:02 +0200 |
| commit | ef104148057ab98f80b1560405b5c02768457096 (patch) | |
| tree | 47e75bc81aacb2e035e7cd43be9616b677b01d04 /gils/wc.rv | |
| parent | 5f6deca073728d0dafa2cd47d841b28d54af3aaf (diff) | |
feat: colors + better ps1
Diffstat (limited to 'gils/wc.rv')
| -rw-r--r-- | gils/wc.rv | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |
