policycoreutils: restorecond: Add -h option to get usage command

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-01-24 11:22:43 -05:00 committed by Eric Paris
parent e8888a7f16
commit 2f9fdc2781
2 changed files with 9 additions and 2 deletions

View File

@ -3,7 +3,7 @@
restorecond \- daemon that watches for file creation and then sets the default SELinux file context restorecond \- daemon that watches for file creation and then sets the default SELinux file context
.SH "SYNOPSIS" .SH "SYNOPSIS"
.B restorecond [\-d] [\-f restorecond_file ] [\-u] [\-v] .B restorecond [\-d] [-h] [\-f restorecond_file ] [\-u] [\-v]
.P .P
.SH "DESCRIPTION" .SH "DESCRIPTION"
@ -20,6 +20,9 @@ the correct file context associated with the policy.
Turns on debugging mode. Application will stay in the foreground and lots of Turns on debugging mode. Application will stay in the foreground and lots of
debugs messages start printing. debugs messages start printing.
.TP .TP
. B \-h
Print usage statement.
.TP
.B \-f restorecond_file .B \-f restorecond_file
Use alternative restorecond.conf file. Use alternative restorecond.conf file.
.TP .TP

View File

@ -175,7 +175,7 @@ int main(int argc, char **argv)
exclude_non_seclabel_mounts(); exclude_non_seclabel_mounts();
atexit( done ); atexit( done );
while ((opt = getopt(argc, argv, "df:uv")) > 0) { while ((opt = getopt(argc, argv, "hdf:uv")) > 0) {
switch (opt) { switch (opt) {
case 'd': case 'd':
debug_mode = 1; debug_mode = 1;
@ -186,6 +186,10 @@ int main(int argc, char **argv)
case 'u': case 'u':
run_as_user = 1; run_as_user = 1;
break; break;
case 'h':
usage(argv[0]);
exit(0);
break;
case 'v': case 'v':
r_opts.verbose++; r_opts.verbose++;
break; break;