summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2014-02-24 21:26:26 +0100
committerDirk Engling <erdgeist@erdgeist.org>2014-02-24 21:26:26 +0100
commit8194bc916918318a6d129e0f1bfeb8ba1bac1900 (patch)
tree19101c0791efc1cca10513f05e432fa00eabc0eb
parent511ed43218ad00ecef3c99077cb106969957df9c (diff)
Add some documentation
-rw-r--r--el.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/el.c b/el.c
index 518b3a7..87dd7fb 100644
--- a/el.c
+++ b/el.c
@@ -58,7 +58,8 @@ static int nextchar( void ) {
58 return getchar(); 58 return getchar();
59 if( *g_immediatelinenums ) 59 if( *g_immediatelinenums )
60 return *g_immediatelinenums++; 60 return *g_immediatelinenums++;
61 return EOF; 61 g_immediatelinenums = 0;
62 return ' ';
62} 63}
63 64
64// scans the text file for the requested line 65// scans the text file for the requested line
@@ -172,6 +173,16 @@ static int acquire_lineno( int c ) {
172 173
173static void usage() { 174static void usage() {
174 fputs( "Usage: el [-0Ggnxh] [-i linenums] filename .. < linenum_file\n", stderr); 175 fputs( "Usage: el [-0Ggnxh] [-i linenums] filename .. < linenum_file\n", stderr);
176
177 fputs( " -i Use <linenums> before (or instead) using line numbers from stdin\n", stderr );
178 fputs( " -0 Line numbers are zero base\n", stderr );
179 fputs( " -x Line numbers default to base 16\n", stderr );
180 fputs( " -g Line numbers are followed by colon (as grep -n produces)\n", stderr );
181 fputs( " -G Like -g but also prepend output line by input line\n", stderr );
182 fputs( " -n Prepend output by line number and colon (like grep -n)\n", stderr );
183 fputs( " -h Print this help\n", stderr );
184 fputs( "\nExample: grep -n Foo File1 | el -Gn File2 File3 | grep Bar | el -Gn File4\n", stderr );
185
175} 186}
176 187
177int main( int argc, char **argv ) { 188int main( int argc, char **argv ) {