diff --git a/caching/cache_check.cc b/caching/cache_check.cc index 4deb346..5bcec34 100644 --- a/caching/cache_check.cc +++ b/caching/cache_check.cc @@ -252,7 +252,11 @@ namespace { << "Options:" << endl << " {-q|--quiet}" << endl << " {-h|--help}" << endl - << " {-V|--version}" << endl; + << " {-V|--version}" << endl + << " {--super-block-only}" << endl + << " {--skip-mappings}" << endl + << " {--skip-hints}" << endl; + } char const *TOOLS_VERSION = "0.1.6"; @@ -266,14 +270,30 @@ int main(int argc, char **argv) flags fs; const char shortopts[] = "qhV"; const struct option longopts[] = { - { "quiet", no_argument, NULL, 'q'}, - { "help", no_argument, NULL, 'h'}, - { "version", no_argument, NULL, 'V'}, + { "quiet", no_argument, NULL, 'q' }, + { "superblock-only", no_argument, NULL, 1 }, + { "skip-mappings", no_argument, NULL, 2 }, + { "skip-hints", no_argument, NULL, 3 }, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, { NULL, no_argument, NULL, 0 } }; while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch(c) { + case 1: + fs.check_mappings_ = false; + fs.check_hints_ = false; + break; + + case 2: + fs.check_mappings_ = false; + break; + + case 3: + fs.check_hints_ = false; + break; + case 'h': usage(cout, basename(argv[0])); return 0; diff --git a/features/cache_check.feature b/features/cache_check.feature index fc3516d..14e48fa 100644 --- a/features/cache_check.feature +++ b/features/cache_check.feature @@ -76,6 +76,13 @@ Feature: cache_check Then it should fail And it should give no output + Scenario: -q is observed + Given input file + And block 1 is zeroed + When I run `cache_check -q input` + Then it should fail + And it should give no output + Scenario: A valid metadata area passes Given metadata containing: """ diff --git a/features/step_definitions/cache_steps.rb b/features/step_definitions/cache_steps.rb index 68c5739..9635893 100644 --- a/features/step_definitions/cache_steps.rb +++ b/features/step_definitions/cache_steps.rb @@ -46,6 +46,9 @@ Options: {-q|--quiet} {-h|--help} {-V|--version} + {--super-block-only} + {--skip-mappings} + {--skip-hints} EOF Then /^usage to stdout$/ do