diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-07 00:48:13 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-07 00:48:13 -0400 |
| commit | 5f9b75d866789bfd5b1466f16cd1d758f52e3104 (patch) | |
| tree | ff2cb1c1091419c0e8bddd4043df5aab49a731d8 /examples | |
| parent | 7a4bf8d3d83b7dceebc2ae6c6bbe47e7e46a2432 (diff) | |
Use exit() more
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/ini.tm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/ini.tm b/examples/ini.tm index 1f818a2e..5e6f438e 100644 --- a/examples/ini.tm +++ b/examples/ini.tm @@ -35,7 +35,7 @@ func parse_ini(filename:Text)->{Text:{Text:Text}}: func main(filename:Text, key:Text): keys := key:split($Pattern"/") if keys.length > 2: - fail(" + exit(1, message=" Too many arguments! $_USAGE ") @@ -47,7 +47,7 @@ func main(filename:Text, key:Text): section := keys[1]:lower() if not data:has(section): - fail("Invalid section name: $section; valid names: $(", ":join([k:quoted() for k in data.keys]))") + exit(1, message="Invalid section name: $section; valid names: $(", ":join([k:quoted() for k in data.keys]))") section_data := data:get(section) if keys.length < 2 or keys[2] == '*': @@ -56,6 +56,6 @@ func main(filename:Text, key:Text): section_key := keys[2]:lower() if not section_data:has(section_key): - fail("Invalid key: $section_key; valid keys: $(", ":join(section_data.keys))") + exit(1, message="Invalid key: $section_key; valid keys: $(", ":join(section_data.keys))") say(section_data:get(section_key)) |
