From db9932a9e2470732e4f61ad6b711e89a92ce65fa Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 28 May 2020 21:26:03 -0700 Subject: 6418 --- apps/cat.mu | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/cat.mu b/apps/cat.mu index 0fb68653..13bf007c 100644 --- a/apps/cat.mu +++ b/apps/cat.mu @@ -3,6 +3,18 @@ fn main _args: (addr array (addr array byte)) -> exit-status/ebx: int { var args/eax: (addr array (addr array byte)) <- copy _args - var n/eax: int <- length args - exit-status <- copy n +$main-body: { + var n/eax: int <- length args + compare n, 1 + { + break-if-> + print-string "usage: cat \n" + break $main-body + } + { + break-if-<= + print-string "success\n" + } + } + exit-status <- copy 0 } -- cgit 1.4.1-2-gfad0 0f171a1ace40bf21118103e'>this commit Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log tree commit diff stats
blob: 73e7b8235588551e92eef3f5cd95cb2bcc456da3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73