diff options
author | wrmr | 2024-11-03 12:49:38 -0500 |
---|---|---|
committer | wrmr | 2024-11-03 12:49:38 -0500 |
commit | 9faead33740e7b5b847478518fd3a270a2aa5c2a (patch) | |
tree | dcf3b0e397bcec261341c598a20621c52b13ef87 /main.c | |
parent | ce088cbf9c3a73e9f9ed3012d31dd6e989d86052 (diff) |
some refactoring to disconnect doc_type from networking
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 5 insertions, 1 deletions
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)) { |