[RFC PATCH 4/4] check: add deprecated options warning

Zorro Lang <[email protected]>
Newsgroups org.kernel.vger.fstests
Message-ID <[email protected]>
To notify xfstests users of deprecated options, add a warning which
does not interfere with test results or golden output.

Signed-off-by: Zorro Lang <[email protected]>
---
 check | 72 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 59 insertions(+), 13 deletions(-)

diff --git a/check b/check
index d19498e6..012b566c 100755
--- a/check
+++ b/check
@@ -275,6 +275,14 @@ _prepare_test_list()
 	rm -f $tmp.list
 }
 
+deprecated_opt_warn()
+{
+	local old=$1
+	shift
+
+	echo "[WARN] $old is deprecated, replace it with $*"
+}
+
 # Backward compatible with the old options mode. Translate word-style options
 # that getopt would misinterpret into long options.
 compat_old_option()
@@ -282,19 +290,57 @@ compat_old_option()
 	check_args=()
 	while [ $# -gt 0 ]; do
 		case "$1" in
-		-nfs)		check_args+=("--fs" "nfs") ;;
-		-afs)		check_args+=("--fs" "afs") ;;
-		-glusterfs)	check_args+=("--fs" "glusterfs") ;;
-		-cifs)		check_args+=("--fs" "cifs") ;;
-		-9p)		check_args+=("--fs" "9p") ;;
-		-fuse)		check_args+=("--fs" "fuse") ;;
-		-virtiofs)	check_args+=("--fs" "virtiofs") ;;
-		-pvfs2)		check_args+=("--fs" "pvfs2") ;;
-		-tmpfs)		check_args+=("--fs" "tmpfs") ;;
-		-ubifs)		check_args+=("--fs" "ubifs") ;;
-		-overlay)	check_args+=("--fs" "overlay") ;;
-		-udiff)		check_args+=("--udiff") ;;
-		*)		check_args+=("$1") ;;
+		-nfs)
+			check_args+=("--fs" "nfs")
+			deprecated_opt_warn "-nfs" "--fs nfs"
+			;;
+		-afs)
+			check_args+=("--fs" "afs")
+			deprecated_opt_warn "-afs" "--fs afs"
+			;;
+		-glusterfs)
+			check_args+=("--fs" "glusterfs")
+			deprecated_opt_warn "-glusterfs" "--fs glusterfs"
+			;;
+		-cifs)
+			check_args+=("--fs" "cifs")
+			deprecated_opt_warn "-cifs" "--fs cifs"
+			;;
+		-9p)
+			check_args+=("--fs" "9p")
+			deprecated_opt_warn "-9p" "--fs 9p"
+			;;
+		-fuse)
+			check_args+=("--fs" "fuse")
+			deprecated_opt_warn "-fuse" "--fs fuse"
+			;;
+		-virtiofs)
+			check_args+=("--fs" "virtiofs")
+			deprecated_opt_warn "-virtiofs" "--fs virtiofs"
+			;;
+		-pvfs2)
+			check_args+=("--fs" "pvfs2")
+			deprecated_opt_warn "-pvfs2" "--fs pvfs2"
+			;;
+		-tmpfs)
+			check_args+=("--fs" "tmpfs")
+			deprecated_opt_warn "-tmpfs" "--fs tmpfs"
+			;;
+		-ubifs)
+			check_args+=("--fs" "ubifs")
+			deprecated_opt_warn "-ubifs" "--fs ubifs"
+			;;
+		-overlay)
+			check_args+=("--fs" "overlay")
+			deprecated_opt_warn "-overlay" "--fs overlay"
+			;;
+		-udiff)
+			check_args+=("--udiff")
+			deprecated_opt_warn "-udiff" "--udiff"
+			;;
+		*)
+			check_args+=("$1")
+			;;
 		esac
 		shift
 	done
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.