|
07:46
dakkar joined
10:37
librasteve_ joined
12:46
librasteve_ left
14:13
apogee_ntv left
|
|||
| disbot4 | <simon_sibl> maybe a silly question but when using sub MAIN, if I make a subset which accept only 'tcp' or 'udp' for example, is there a good way to show an error to the user if they type something else ? | 14:59 | |
| <simon_sibl> because the behavior otherwise is simply to show the usage without explanation on why what the user typed as command isnt valid | |||
| <simon_sibl> I have something like: | |||
| <simon_sibl> subset MODE of Str where { $ eq 'tcp'|'udp' or die "Error: Invalid mode '$'. Choose 'tcp' or 'udp'." }; | 15:00 | ||
| <simon_sibl> but then it shows a stack trace, which I would like to be optional if thats doable | |||
| <simon_sibl> alright: note and exit 1 it is xD | 15:06 | ||
| <simon_sibl> although another question, why Int named arguments in MAIN requires a '=' ? | 15:14 | ||
| <simon_sibl> I cannot do --port 3, I have to do --port=80 | |||
| <librasteve> guifa: lol … since this is “beginner” channel, I tend to think that stuff like ::?CLASS:U: is unlikely to be the first port of call, I am curious to know where that would beat something like | 15:17 | ||
| <simon_sibl> whats interesting is that in the doc: docs.raku.org/language/create-cli, it shows this "[--length=<Int>]" for Int but when I use it, it shows "[--length[=<Int>]]" | |||
| <librasteve> class Shape {method point(Shape:U: $x,$y) {…} } | 15:19 | ||
|
15:42
librasteve_ joined
|
|||
| librasteve_ | rakudoweekly.blog/2026/06/22/2026-25-dutch-art/ | 16:35 | |
|
16:43
dakkar left
18:07
sjn left
18:08
sjn joined
18:36
librasteve_ left
19:38
librasteve_ joined
22:32
apogee_ntv joined
|
|||