summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-06-05 21:36:45 +0000
committerLennart Poettering <lennart@poettering.net>2005-06-05 21:36:45 +0000
commitc71069d17232986e6b55e723ed1a9733edcfd49b (patch)
treec12085071d26600713566560fa5d26646d8831a0
parentb2972e79c5d11dfa0625bf43838cb65209f7e632 (diff)
update help text
git-svn-id: file:///home/lennart/svn/public/syrep/trunk@77 07ea20a6-d2c5-0310-9e02-9ef735347d72
-rw-r--r--src/syrep.c76
1 files changed, 47 insertions, 29 deletions
diff --git a/src/syrep.c b/src/syrep.c
index c9ad001..f9509d3 100644
--- a/src/syrep.c
+++ b/src/syrep.c
@@ -531,17 +531,19 @@ static void free_args(void) {
free(args.inputs);
}
-static int help(const char *argv0) {
+static int help(FILE *f, const char *argv0) {
- fprintf(stderr,
+ fprintf(f,
"%s -- Synchronize File Repositories\n\n"
"Usage: %s [options...] <command> [arguments...]\n\n"
"General options:\n"
" -v --verbose Enable verbose operation\n"
- " -T --local-temp Use temporary directory inside repository\n"
- " --ignore-origin Don't warn if snapshot not local in update, merge, makepatch\n"
+ " -T --local-temp Use temporary directory inside\n"
+ " repository\n"
+ " --ignore-origin Don't warn if snapshot not local in\n"
+ " update, merge, makepatch\n"
" -z --compress Compress snapshots or patches\n"
" -p --progress Show progress\n\n"
@@ -551,55 +553,71 @@ static int help(const char *argv0) {
"Specific commands:\n"
" --list SNAPSHOT List a repository snapshot\n"
- " --show-deleted Show deleted entries of repository snapshot\n"
+ " --show-deleted Show deleted entries of repository\n"
+ " snapshot\n"
" --show-by-md Show files by message digests\n"
" --show-times Show first and last seen times\n"
" --sort Sort chronologically\n\n"
- " --info SNAPSHOT Show information about a repository or snapshot\n\n"
+ " --info SNAPSHOT Show information about a repository or\n"
+ " snapshot\n\n"
" --history SNAPSHOT Show history of a repository or snapshot\n\n"
- " --dump SNAPSHOT Show a structure dump of a repository or snapshot\n\n"
+ " --dump SNAPSHOT Show a structure dump of a repository or\n"
+ " snapshot\n\n"
" --update DIRECTORY Update (or create) a repository snapshot\n"
- " -SSTRING --snapshot=STRING Use a different snapshot file than the one contained\n"
- " in the repository\n"
- " -CSTRING --cache=STRING Use a different cache file than the one contained in\n"
- " the repository\n"
+ " -SSTRING --snapshot=STRING Use a different snapshot file than the\n"
+ " one contained in the repository\n"
+ " -CSTRING --cache=STRING Use a different cache file than the one\n"
+ " contained in the repository\n"
" --no-cache Don't use a message digest cache\n"
- " --no-purge Don't purge obsolete entries from cache after update run\n"
+ " --no-purge Don't purge obsolete entries from cache\n"
+ " after update run\n"
" --ro-cache Use read only cache\n\n"
- " --diff SNAPSHOT SNAPSHOT Show difference between two repositories or snapshots\n"
- " --sizes -s Show sizes for files to copy (works only with repositories)\n"
+ " --diff SNAPSHOT SNAPSHOT Show difference between two repositories\n"
+ " or snapshots\n"
+ " --sizes -s Show sizes for files to copy (works only\n"
+ " with repositories)\n"
" --human-readable -H Show sizes in human readable from\n"
- " --merge SNAPSHOT DIRECTORY Merge a snapshot into a repository (perform deletes,\n"
- " renames only)\n"
+ " --merge SNAPSHOT DIRECTORY Merge a snapshot into a repository\n"
+ " (perform deletes, renames only)\n"
" --merge PATCH DIRECTORY Merge a patch into a repository\n"
" --merge DIRECTORY DIRECTORY Merge a repository into a repository\n"
" -q --question Ask a question before each action\n"
" -P --prune-empty Prune empty directories\n"
" --keep-trash Don't empty trash\n"
- " --check-md Check message digest of files prior to deletion or replacement\n"
- " --always-copy Always copy instead of hard link\n\n"
-
- " --makepatch DIRECTORY SNAPSHOT Make a patch against the specified repository\n"
- " -oSTRING --output-file=STRING Write output to specified file instead of STDOUT\n"
- " --include-all Include files in patch which do exist on the other side under a \n"
+ " --check-md Check message digest of files prior to\n"
+ " deletion or replacement\n"
+ " --always-copy Always copy instead of hard link\n\n",
+ argv0, argv0);
+
+ fprintf(f,
+ " --makepatch DIRECTORY SNAPSHOT Make a patch against the specified\n"
+ " repository\n"
+ " -oSTRING --output-file=STRING Write output to specified file instead\n"
+ " of STDOUT\n"
+ " --include-all Include files in patch which do exist on\n"
+ " the other side under a \n"
" different name\n\n"
- " --extract SNAPSHOT Extract the contents of a snapshot or patch\n"
+ " --extract SNAPSHOT Extract the contents of a snapshot or\n"
+ " patch\n"
" -DSTRING --output-directory=STRING Write output to specified directory\n\n"
" --cleanup DIRECTORY Remove syrep info from repository\n"
- " -lINT --cleanup-level=INT 1 - just remove temporary data and trash (default)\n"
+ " -lINT --cleanup-level=INT 1 - just remove temporary data and trash\n"
+ " (default)\n"
" 2 - remove MD cache as well\n"
" 3 - remove all syrep data\n\n"
- " --forget SNAPSHOT Repackage snapshot dropping outdated information\n"
- " --remember DAYS Information of how many days should be kept? (defaults to 180)\n",
- argv0, argv0);
+ " --forget SNAPSHOT Repackage snapshot dropping outdated\n"
+ " information\n"
+ " --remember DAYS Information of how many days should be\n"
+ " kept? (defaults to 180)\n");
+
return 0;
}
@@ -651,7 +669,7 @@ int main(int argc, char *argv[]) {
atexit(free_args);
if (args.help_given)
- return help(bn);
+ return help(stdout, bn);
else if (args.version_given)
return version(bn);
else if (args.list_flag)
@@ -677,7 +695,7 @@ int main(int argc, char *argv[]) {
else if (args.forget_flag)
return do_forget();
- help(bn);
+ help(stderr, bn);
return 1;
}