From 341e258208647cacca59c324fc658ac9c068c7c5 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Fri, 16 Dec 2022 11:31:21 +0100 Subject: Add -m flag --- main.ha | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main.ha') diff --git a/main.ha b/main.ha index 467f773..5f55a91 100644 --- a/main.ha +++ b/main.ha @@ -19,6 +19,7 @@ let searchterm: str = ""; let searchforward: bool = true; let nulterm: bool = false; +let msg: str = ""; type mainUI = struct { list: *list::listwidget, @@ -77,7 +78,8 @@ fn resize(list: *list::listwidget) void = { export fn main() void = { const cmd = getopt::parse(os::args, "interactive list", - ('0', "NUL terminated output") + ('0', "NUL terminated output"), + ('m', "msg", "string to print when 'h' is pressed (this can be used for custom help messages or building basic extra external features)"), ); defer getopt::finish(&cmd); @@ -86,6 +88,8 @@ export fn main() void = { switch (opt.0) { case '0' => nulterm = true; + case 'm' => + msg = opt.1; }; }; -- cgit v1.2.3