diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/1.cff | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1,6 +1,6 @@ import "libc.hff"; -extern fn main(argc int) int { +extern fn main(argc int, argv **u8) int { switch argc - 1 { case 0, 1; printf("zero or one\n"); @@ -14,4 +14,15 @@ extern fn main(argc int) int { case else printf("its %d\n", argc); } + + switch { + case argv[1] != #null and strcmp(argv[1], "hello") == 0; + printf("world\n"); + + case argv[1] != #null and strcmp(argv[1], "42") == 0; + printf("forty two\n"); + + case else + printf("- %s\n", argv[1]); + } } |