diff options
Diffstat (limited to 'src/metastore.c')
-rw-r--r-- | src/metastore.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/metastore.c b/src/metastore.c index c6f48cf..2bc2a89 100644 --- a/src/metastore.c +++ b/src/metastore.c @@ -47,6 +47,7 @@ static struct metasettings settings = { .do_emptydirs = false, .do_removeemptydirs = false, .do_git = false, + .format = 0, }; /* Used to create lists of dirs / other files which are missing in the fs */ @@ -462,6 +463,7 @@ usage(const char *arg0, const char *message) " -E, --remove-empty-dirs Remove extra empty directories\n" " -g, --git Do not omit .git directories\n" " -f, --file=FILE Set metadata file (" METAFILE " by default)\n" +" -r, --format=fmt Set file format to save as\n" ); exit(message ? EXIT_FAILURE : EXIT_SUCCESS); @@ -482,6 +484,7 @@ static struct option long_options[] = { { "remove-empty-dirs", no_argument, NULL, 'E' }, { "git", no_argument, NULL, 'g' }, { "file", required_argument, NULL, 'f' }, + { "format", required_argument, NULL, 'r' }, { NULL, 0, NULL, 0 } }; @@ -498,7 +501,7 @@ main(int argc, char **argv) i = 0; while (1) { int option_index = 0; - c = getopt_long(argc, argv, "csadVhvqmeEgf:", + c = getopt_long(argc, argv, "csadVhvqmeEgf:r:", long_options, &option_index); if (c == -1) break; @@ -517,6 +520,7 @@ main(int argc, char **argv) break; case 'g': /* git */ settings.do_git = true; break; case 'f': /* file */ settings.metafile = optarg; break; + case 'r': /* format */ settings.format = atoi(optarg);break; default: usage(argv[0], "unknown option"); } @@ -568,7 +572,7 @@ main(int argc, char **argv) mentries_compare(real, stored, compare_print, &settings); break; case ACTION_SAVE: - mentries_tofile(real, settings.metafile); + mentries_tofile(real, settings.metafile, settings.format); break; case ACTION_APPLY: mentries_compare(real, stored, compare_fix, &settings); |