summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2007-05-19 18:51:01 +0200
committerDavid Härdeman <david@hardeman.nu>2007-05-19 18:51:01 +0200
commit3e5ad4cf5f75f7e5ea42197f4baa7a56f86a697e (patch)
tree60845687bdb988d20fe544d7fe1c57f3a481fd67
parent4b33b9b826d88c76dd562bebade1eacfa4a7d4a6 (diff)
Add a man page and update help message
-rw-r--r--metastore.153
-rw-r--r--metastore.c5
2 files changed, 56 insertions, 2 deletions
diff --git a/metastore.1 b/metastore.1
new file mode 100644
index 0000000..60f2db9
--- /dev/null
+++ b/metastore.1
@@ -0,0 +1,53 @@
+.TH metastore "1" "May 2007"
+.\"
+.SH NAME
+metastore \- stores and restores filesystem metadata
+.\"
+.SH SYNOPSIS
+\fBmetastore\fR \fIACTION\fR [\fIOPTION...\fR] [\fIPATH...\fR]
+.\"
+.SH DESCRIPTION
+Stores or restores metadata (owner, group, permissions, xattrs and optionally
+mtime) for a filesystem tree. This can be used to preserve the metadata in
+situations where it is usually not stored (git and tar for example) or as
+a tripwire like mechanism to detect any changes to metadata. Note that e.g.
+SELinux stores its labels in xattrs so care should be taken when applying
+stored metadata to make sure that system security is not compromised.
+.\"
+.SH ACTIONS
+.TP
+.B -d, --diff
+Shows the difference between the stored and real metadata.
+.TP
+.B -s, --save
+Saves the current metadata to ./.metadata.
+.TP
+.B -a, --apply
+Attempts to apply the stored metadata to the file system.
+.TP
+.B -h, --help
+Prints a help message and exits.
+.\"
+.SH OPTIONS
+.TP
+.B -v, --verbose
+Causes metastore to print more verbose messages. Can be repeated more than
+once for even more verbosity.
+.TP
+.B -q, --quiet
+Causes metastore to print less verbose messages. Can be repeated more than
+once for even less verbosity.
+.TP
+.B -m, --mtime
+Causes metastore to also take mtime into account for the diff or apply actions.
+.\"
+.SH PATHS
+If no path is specified, metastore will use the current directory as the basis
+for the actions. This is the recommended way of executing metastore.
+Alternatively, one or more paths can be specified and they will each be
+examined. Later invocations should be made using the exact same paths to
+ensure that the stored metadata is interpreted correctly.
+.\"
+.SH AUTHOR
+Written by David Härdeman <david@hardeman.nu>
+
diff --git a/metastore.c b/metastore.c
index 008a90b..7fae7ff 100644
--- a/metastore.c
+++ b/metastore.c
@@ -204,7 +204,7 @@ usage(const char *arg0, const char *message)
{
if (message)
msg(MSG_CRITICAL, "%s: %s\n\n", arg0, msg);
- msg(MSG_CRITICAL, "Usage: %s ACTION [OPTIONS] [PATH]...\n\n", arg0);
+ msg(MSG_CRITICAL, "Usage: %s ACTION [OPTION...] [PATH...]\n\n", arg0);
msg(MSG_CRITICAL, "Where ACTION is one of:\n"
" -d, --diff\tShow differences between stored and real metadata\n"
" -s, --save\tSave current metadata\n"
@@ -212,7 +212,8 @@ usage(const char *arg0, const char *message)
" -h, --help\tHelp message (this text)\n\n"
"Valid OPTIONS are (can be given more than once):\n"
" -v, --verbose\tPrint more verbose messages\n"
- " -q, --quiet\tPrint less verbose messages\n");
+ " -q, --quiet\tPrint less verbose messages\n"
+ " -m, --mtime\tAlso take mtime into account for diff or apply\n");
exit(message ? EXIT_FAILURE : EXIT_SUCCESS);
}