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(-) (limited to 'apps') 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