~torresjrjr/public-inbox

entr: language changes and switch expression fix v1 APPLIED

kurth4cker: 1
 language changes and switch expression fix

 1 files changed, 4 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~torresjrjr/public-inbox/patches/50900/mbox | git am -3
Learn more about email & git

[PATCH entr] language changes and switch expression fix Export this patch

* for-each change
* never type
* switch expression should handle all possibilities

Signed-off-by: kurth4cker <kurth4cker@gmail.com>
---
 entr.ha | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/entr.ha b/entr.ha
index f35bc74..4f3c2ff 100644
--- a/entr.ha
+++ b/entr.ha
@@ -21,8 +21,7 @@ export fn main() void = {
	const cmd = getopt::parse(os::args, help...);
	defer getopt::finish(&cmd);

	for (let i = 0z; i < len(cmd.opts); i += 1) {
		const opt = cmd.opts[i];
	for (let opt .. cmd.opts) {
		switch (opt.0) {
		case 'a' =>
			abort("unimplemented option: -a");
@@ -40,6 +39,8 @@ export fn main() void = {
			abort("unimplemented option: -s");
		case 'z' =>
			abort("unimplemented option: -z");
		case =>
			abort();
		};
	};

@@ -54,7 +55,7 @@ export fn main() void = {
	const stat = os::exec::wait(&proc);
};

@noreturn fn usage(help: []getopt::help, flag: (rune | void)) void = {
fn usage(help: []getopt::help, flag: (rune | void)) never = {
	if (flag is rune) {
		fmt::errorfln("{}: invalid option parameter for -{}",
			os::args[0], flag: rune,
-- 
2.44.0
Hi Kurt,

As you can see, this is quite a dead project,
but thanks for the patch nonetheless.

Thanks. Applied to master, with some changes.

To git.sr.ht:~torresjrjr/entr
   4c40382..2c97aac  master -> master

commit 2c97aac207018b6291a1f0f4c386cc8e219e6406
Author: kurth4cker <kurth4cker@gmail.com>
Date:   Thu Apr 11 09:58:15 2024 +0300

    update per hare 0.24.0

    language changes and switch expression fix

    * for-each change
    * never type
    * switch expression should handle all possibilities

    Signed-off-by: kurth4cker <kurth4cker@gmail.com>
    Signed-off-by: Byron Torres <b@torresjrjr.com>
    Co-authored-by: Byron Torres <b@torresjrjr.com>