From 5b4c0d04e2d55a27d0cfcd2cd4e19c66494706ee Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 8 Oct 2018 21:02:49 -0400 Subject: [PATCH] added flag for specifying line number --- tide.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tide.c b/tide.c index 092af28..b6721ec 100644 --- a/tide.c +++ b/tide.c @@ -472,8 +472,10 @@ static void usage(void) { #ifndef TEST int main(int argc, char** argv) { + long int line_num = 0; #define BOOLARG() (EOPTARG(usage()), optarg_[0] == '0' ? 0 : 1) #define STRARG() (EOPTARG(usage())) + #define NUMARG() (strtoul(EOPTARG(usage()),0,0)) OPTBEGIN { case 'I': CopyIndent = BOOLARG(); break; case 'W': TrimOnSave = BOOLARG(); break; @@ -481,6 +483,7 @@ int main(int argc, char** argv) { case 'N': DosLineFeed = BOOLARG(); break; case 'T': TagString = STRARG(); break; case 'C': ShellCmd[0] = STRARG(); break; + case 'l': line_num = NUMARG(); break; } OPTEND; /* setup the shell */ @@ -495,6 +498,7 @@ int main(int argc, char** argv) { char* path = realpath(*argv, NULL); if (!path) path = *argv; /* if file doesnt exist, use the original name */ view_init(win_view(EDIT), path); + view_setln(win_view(EDIT), line_num); win_title(path); win_prop_set("TIDE_FILE", "file", path); } else { -- 2.54.0