2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
|
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
|
-
+
-
+
-
+
+
-
+
|
fossil_path_free(zNative);
return n;
}
/*
** COMMAND: test-dir-size
**
** Usage: %fossil test-dir-size NAME [GLOB] [--nodots]
** Usage: %fossil test-dir-size NAME [GLOB] [--no-dots]
**
** Return the number of objects in the directory NAME. If GLOB is
** provided, then only count objects that match the GLOB pattern.
** if --nodots is specified, omit files that begin with ".".
** if --no-dots is specified, omit files that begin with ".".
*/
void test_dir_size_cmd(void){
int omitDotFiles = find_option("nodots",0,0)!=0;
int omitDotFiles = find_option("no-dots",0,0)!=0
|| find_option("nodots",0,0)!=0;
const char *zGlob;
const char *zDir;
verify_all_options();
if( g.argc!=3 && g.argc!=4 ){
usage("NAME [GLOB] [-nodots]");
usage("NAME [GLOB] [--no-dots]");
}
zDir = g.argv[2];
zGlob = g.argc==4 ? g.argv[3] : 0;
fossil_print("%d\n", file_directory_size(zDir, zGlob, omitDotFiles));
}
/*
|