Skip to content

Commit

Permalink
better usage messages for runt.icn
Browse files Browse the repository at this point in the history
  • Loading branch information
eschen42 committed Sep 19, 2022
1 parent a10e69a commit 5dad22b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions runt.icn
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@

$include "wora.icn"
$include "fileDirIo.icn"
$define USAGE "usage: icon runt.icn [--continue] [--verbose] dir_names"
$define USAGE1 " --continue: run other tests after a test fails"
$define USAGE2 " --verbose: trace test results"
$define USAGE3 " --help - print this message"

link popen # for procedure popen

Expand All @@ -65,9 +69,12 @@ procedure main(args)
local linObserved # observed line
local testName # name of test, test_*
local traceout # if !args == "--verbose" then write else 2
if !args == "--help" then {
write("usage: icon runt.icn [--continue] [--verbose] [<zero or more dirs>]")
exit(0)
if *args < 1 | !args == "--help" then {
write(USAGE)
write(USAGE1)
write(USAGE2)
write(USAGE3)
exit(if *args < 1 then 1 else 0)
}
traceout := if !args == "--verbose" then write else 2
abort := if !args == "--continue" then write_abort else stop
Expand Down

0 comments on commit 5dad22b

Please sign in to comment.