aboutsummaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
Diffstat (limited to 'main.ha')
-rw-r--r--main.ha7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.ha b/main.ha
index 5f55a91..1d00003 100644
--- a/main.ha
+++ b/main.ha
@@ -80,6 +80,7 @@ export fn main() void = {
"interactive list",
('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)"),
+ ('s', "query", "search for a given item when opening the il"),
);
defer getopt::finish(&cmd);
@@ -90,6 +91,8 @@ export fn main() void = {
nulterm = true;
case 'm' =>
msg = opt.1;
+ case 's' =>
+ searchterm = strings::dup(opt.1);
};
};
@@ -124,6 +127,10 @@ export fn main() void = {
let layout = layout::newlayout(&l);
defer layout::finishall(&layout);
+ if (searchterm != "") {
+ list::search(&l, searchterm);
+ };
+
//defer free(searchterm);
//libtui::clear(l.widget.ui);