summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
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)) {