]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub_all: report version
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Apr 2018 15:34:11 +0000 (10:34 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 12 Apr 2018 15:34:11 +0000 (10:34 -0500)
Make xfs_scrub_all -V report its version like the other xfs tools.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
man/man8/xfs_scrub_all.8
scrub/Makefile
scrub/xfs_scrub_all.in

index 5e1420b416ac5a9196486155af22267244f92225..74548802eda0bfd7f3ba0964ae48e9cadfe2a0dd 100644 (file)
@@ -3,6 +3,9 @@
 xfs_scrub_all \- scrub all mounted XFS filesystems
 .SH SYNOPSIS
 .B xfs_scrub_all
+[
+.B \-hV
+]
 .SH DESCRIPTION
 .B xfs_scrub_all
 attempts to read and check all the metadata on all mounted XFS filesystems.
@@ -13,6 +16,13 @@ in a restricted fashion.
 Mounted filesystems are mapped to physical storage devices so that scrub
 operations can be run in parallel so long as no two scrubbers access
 the same device simultaneously.
+.SH OPTIONS
+.TP
+.B \-h
+Display help.
+.TP
+.B \-V
+Prints the version number and exits.
 .SH EXIT CODE
 The exit code returned by
 .B xfs_scrub_all
index bcc05a0ed994ef04cbe34ebde368403fc4a070d4..482e8a7b8585d278c3c23df93e0dceae99d0c0e3 100644 (file)
@@ -102,6 +102,7 @@ default: depend $(LTCOMMAND) $(XFS_SCRUB_ALL_PROG) $(OPTIONAL_TARGETS)
 xfs_scrub_all: xfs_scrub_all.in
        @echo "    [SED]    $@"
        $(Q)$(SED) -e "s|@sbindir@|$(PKG_ROOT_SBIN_DIR)|g" \
+                  -e "s|@pkg_version@|$(PKG_VERSION)|g" \
                   -e "s|@scrub_args@|$(XFS_SCRUB_ARGS)|g" < $< > $@
        $(Q)chmod a+x $@
 
index 80f07d5c8b0283dd21a3f53f7c3ddacf2e48b2f9..aed66a1ac26a0c8781fa49df35950a6f0bb4cb1b 100644 (file)
@@ -26,6 +26,7 @@ import threading
 import time
 import sys
 import os
+import argparse
 
 retcode = 0
 terminate = False
@@ -139,6 +140,16 @@ def main():
                thr.start()
        global retcode, terminate
 
+       parser = argparse.ArgumentParser( \
+                       description = "Scrub all mounted XFS filesystems.")
+       parser.add_argument("-V", help = "Report version and exit.", \
+                       action = "store_true")
+       args = parser.parse_args()
+
+       if args.V:
+               print("xfs_scrub_all version @pkg_version@")
+               sys.exit(0)
+
        fs = find_mounts()
 
        # Tail the journal if we ourselves aren't a service...