~sircmpwn/public-inbox

powerctl: main.c: remove variadic arguments from getopt::printhelp calls v1 PROPOSED

Fredrik Foss-Indrehus: 1
 main.c: remove variadic arguments from getopt::printhelp calls

 1 files changed, 5 insertions(+), 5 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/~sircmpwn/public-inbox/patches/56841/mbox | git am -3
Learn more about email & git

[PATCH powerctl] main.c: remove variadic arguments from getopt::printhelp calls Export this patch

getopt::printhelp no longer accept variadic arguments, so remove spread
operator (...).

Signed-off-by: Fredrik Foss-Indrehus <fred@ffoss.net>
---
I'm all too new to hare (and this email workflow too, forgive me), but
this at least make it compile and function again.

Build error before fix:

  main.ha:47:42: error: Function type does not permit variadic argument list

  47 |                            getopt::printhelp(os::stderr, "powerctl", help...)!;
     |                                             ^

  [...and all other identical lines...]

 main.ha | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/main.ha b/main.ha
index cafaf37..105a2e2 100644
--- a/main.ha
+++ b/main.ha
@@ -44,7 +44,7 @@ export fn main() void = {

	if (op == operation::QUERY) {
		if (len(cmd.args) != 0) {
			getopt::printhelp(os::stderr, "powerctl", help...)!;
			getopt::printhelp(os::stderr, "powerctl", help)!;
			os::exit(1);
		};

@@ -64,7 +64,7 @@ export fn main() void = {
	};

	if (len(cmd.args) != 1) {
		getopt::printhelp(os::stderr, "powerctl", help...)!;
		getopt::printhelp(os::stderr, "powerctl", help)!;
		os::exit(1);
	};

@@ -76,7 +76,7 @@ export fn main() void = {
		case let state: disk_state =>
			yield state;
		case errors::invalid =>
			getopt::printhelp(os::stderr, "powerctl", help...)!;
			getopt::printhelp(os::stderr, "powerctl", help)!;
			os::exit(1);
		};
		const result = set_disk_state(state);
@@ -95,7 +95,7 @@ export fn main() void = {
		case let state: mem_state =>
			yield state;
		case errors::invalid =>
			getopt::printhelp(os::stderr, "powerctl", help...)!;
			getopt::printhelp(os::stderr, "powerctl", help)!;
			os::exit(1);
		};
		const result = set_mem_state(state);
@@ -105,7 +105,7 @@ export fn main() void = {
		case let state: sleep_state =>
			yield state;
		case errors::invalid =>
			getopt::printhelp(os::stderr, "powerctl", help...)!;
			getopt::printhelp(os::stderr, "powerctl", help)!;
			os::exit(1);
		};
		const result = set_sleep_state(state);
-- 
2.47.1
I should specify that this was built against hare dev+10e1b3c (master
branch).

Let me know what you think!