aboutsummaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2022-12-17 18:46:27 +0100
committerJulian Hurst <ark@mansus.space>2022-12-17 18:46:27 +0100
commitfd23c61da94a5e15d2cd47cb28c1654bd6fb9fd7 (patch)
tree309653b6cc2c77c6791bb999aac4451d3d25d686 /main.ha
parent341e258208647cacca59c324fc658ac9c068c7c5 (diff)
downloadilhare-fd23c61da94a5e15d2cd47cb28c1654bd6fb9fd7.tar.gz
Add -s flag for search on open support
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);