From 9faead33740e7b5b847478518fd3a270a2aa5c2a Mon Sep 17 00:00:00 2001 From: wrmr Date: Sun, 3 Nov 2024 12:49:38 -0500 Subject: some refactoring to disconnect doc_type from networking --- main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 738a3e9..2ac6d21 100644 --- a/main.c +++ b/main.c @@ -79,10 +79,14 @@ int cmd_get(char *buf, size_t n) { return !!fgets(buf, n, stdin); } -int main(void) { +int main(int argc, const char **argv) { struct nav_state ns; char cmd_buf[1024]; nav_init(&ns); + if (argc == 2) { + if (nav_to(&ns, argv[1])) perr("navigation failure"); + } + nav_redraw(&ns); while (cmd_get(cmd_buf, sizeof cmd_buf)) { cmd_trim(cmd_buf, sizeof cmd_buf); if (cmd_do(cmd_buf, &ns)) { -- cgit 1.4.1-2-gfad0