17
17
#endif
18
18
#include "csloc.h"
19
19
#define VERSION_MINOR "9"
20
- #define VERSION_PATCH "2 "
20
+ #define VERSION_PATCH "3 "
21
21
int main (int argl ,char * argv [])
22
22
{
23
23
if (argl == 1 )
@@ -39,6 +39,7 @@ int main(int argl,char*argv[])
39
39
puts ("-h to not count files beginning with a ., such files are considered hidden on linux." );
40
40
puts ("-cNUM specifies that NUM non-whitespace characters are required to count as a valid line." );
41
41
puts ("-q to not output complete sentences." );
42
+ puts ("-u to not show the file names, only the numbers." );
42
43
puts ("-x to specify file extensions to count, without the . in the front." );
43
44
puts ("This option must come last, as all other args after it are considered to be in the list of file extensions." );
44
45
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[])
106
107
currop = * it ;
107
108
switch (currop )
108
109
{
110
+ case 'u' :
111
+ options |= CSLOC_ULTRAQUIET ;
112
+ break ;
109
113
case 'y' :
110
114
options |= CSLOC_SIF ;
111
115
if (fel != 0 )
@@ -197,7 +201,9 @@ int main(int argl,char*argv[])
197
201
fprintf (ofh , "\033\133%im" , col );
198
202
if (CSLOC_ISQUIET (options ))
199
203
{
200
- if (numfirst )
204
+ if (CSLOC_ISUQUIET (options ))
205
+ fprintf (ofh , "%zu\n" , dat [i ].val );
206
+ else if (numfirst )
201
207
fprintf (ofh , "%zu %s\n" , dat [i ].val , dat [i ].name );
202
208
else
203
209
fprintf (ofh , "%s %zu\n" , dat [i ].name , dat [i ].val );
@@ -219,7 +225,9 @@ int main(int argl,char*argv[])
219
225
}
220
226
if (CSLOC_ISQUIET (options ))
221
227
{
222
- if (numfirst )
228
+ if (CSLOC_ISUQUIET (options ))
229
+ fprintf (ofh , "%zu\n" , total );
230
+ else if (numfirst )
223
231
fprintf (ofh , "%zu %s\n" , total , dir );
224
232
else
225
233
fprintf (ofh , "%s %zu\n" , dir , total );
@@ -239,7 +247,9 @@ int main(int argl,char*argv[])
239
247
total = cnt_single_file (dir , cr );
240
248
if (CSLOC_ISQUIET (options ))
241
249
{
242
- if (numfirst )
250
+ if (CSLOC_ISUQUIET (options ))
251
+ fprintf (ofh , "%zu\n" , total );
252
+ else if (numfirst )
243
253
fprintf (ofh , "%zu %s\n" , total , dir );
244
254
else
245
255
fprintf (ofh , "%s %zu\n" , dir , total );
0 commit comments