diff options
| author | dacctal <dacctalyt@gmail.com> | 2026-04-14 19:31:34 +0000 |
|---|---|---|
| committer | dacctal <dacctalyt@gmail.com> | 2026-04-14 19:31:34 +0000 |
| commit | 2f10c2daea01738465c45f95162c0d56ddbea643 (patch) | |
| tree | 91b4cef5f7281dbf824f89853b24a8b50e54bf81 /main.v | |
| parent | c19258a3e31aabc1a0aca42cbf3d6af2eee61c8f (diff) | |
Diffstat (limited to 'main.v')
| -rw-r--r-- | main.v | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,12 +1,21 @@ import os +import is_lines + fn main() { if os.args.len <= 1 { println("usage: prile [filename]...") exit(1) } + + mut lines := is_lines(os.args) + for arg in os.args[1..] { if !os.is_file(arg) { continue } - println(os.read_file(arg) or {""}) + content := os.read_file(arg) or {""} + for i, line in content.split('\n') { + if lines { println('${i+1:3} | ${line)}' } + else { println(line) } + } } } |
