1717#endif
1818#include "csloc.h"
1919#define VERSION_MINOR "9"
20- #define VERSION_PATCH "2 "
20+ #define VERSION_PATCH "3 "
2121int main (int argl ,char * argv [])
2222{
2323 if (argl == 1 )
@@ -39,6 +39,7 @@ int main(int argl,char*argv[])
3939 puts ("-h to not count files beginning with a ., such files are considered hidden on linux." );
4040 puts ("-cNUM specifies that NUM non-whitespace characters are required to count as a valid line." );
4141 puts ("-q to not output complete sentences." );
42+ puts ("-u to not show the file names, only the numbers." );
4243 puts ("-x to specify file extensions to count, without the . in the front." );
4344 puts ("This option must come last, as all other args after it are considered to be in the list of file extensions." );
4445 puts ("Add ! in front of an extension to forbid counting all files with that extension." );
@@ -106,6 +107,9 @@ int main(int argl,char*argv[])
106107 currop = * it ;
107108 switch (currop )
108109 {
110+ case 'u' :
111+ options |= CSLOC_ULTRAQUIET ;
112+ break ;
109113 case 'y' :
110114 options |= CSLOC_SIF ;
111115 if (fel != 0 )
@@ -197,7 +201,9 @@ int main(int argl,char*argv[])
197201 fprintf (ofh , "\033\133%im" , col );
198202 if (CSLOC_ISQUIET (options ))
199203 {
200- if (numfirst )
204+ if (CSLOC_ISUQUIET (options ))
205+ fprintf (ofh , "%zu\n" , dat [i ].val );
206+ else if (numfirst )
201207 fprintf (ofh , "%zu %s\n" , dat [i ].val , dat [i ].name );
202208 else
203209 fprintf (ofh , "%s %zu\n" , dat [i ].name , dat [i ].val );
@@ -219,7 +225,9 @@ int main(int argl,char*argv[])
219225 }
220226 if (CSLOC_ISQUIET (options ))
221227 {
222- if (numfirst )
228+ if (CSLOC_ISUQUIET (options ))
229+ fprintf (ofh , "%zu\n" , total );
230+ else if (numfirst )
223231 fprintf (ofh , "%zu %s\n" , total , dir );
224232 else
225233 fprintf (ofh , "%s %zu\n" , dir , total );
@@ -239,7 +247,9 @@ int main(int argl,char*argv[])
239247 total = cnt_single_file (dir , cr );
240248 if (CSLOC_ISQUIET (options ))
241249 {
242- if (numfirst )
250+ if (CSLOC_ISUQUIET (options ))
251+ fprintf (ofh , "%zu\n" , total );
252+ else if (numfirst )
243253 fprintf (ofh , "%zu %s\n" , total , dir );
244254 else
245255 fprintf (ofh , "%s %zu\n" , dir , total );
0 commit comments