aboutsummaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
Diffstat (limited to 'main.ha')
-rw-r--r--main.ha17
1 files changed, 17 insertions, 0 deletions
diff --git a/main.ha b/main.ha
index 40718e6..467f773 100644
--- a/main.ha
+++ b/main.ha
@@ -11,12 +11,15 @@ use unix::tty;
use unix::signal;
use unix::poll;
use errors;
+use getopt;
let u: mainUI = mainUI {...};
let searchterm: str = "";
let searchforward: bool = true;
+let nulterm: bool = false;
+
type mainUI = struct {
list: *list::listwidget,
};
@@ -72,6 +75,20 @@ fn resize(list: *list::listwidget) void = {
};
export fn main() void = {
+ const cmd = getopt::parse(os::args,
+ "interactive list",
+ ('0', "NUL terminated output")
+ );
+ defer getopt::finish(&cmd);
+
+ for (let i = 0z; i < len(cmd.opts); i += 1) {
+ const opt = cmd.opts[i];
+ switch (opt.0) {
+ case '0' =>
+ nulterm = true;
+ };
+ };
+
let in = match (io::drain(os::stdin)) {
case let in: []u8 =>
yield in;