btrfs-progs: tests: make sure _is_file_or_command does not get confused
authorDavid Sterba <dsterba@suse.com>
Fri, 15 Sep 2017 14:18:00 +0000 (16:18 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Sep 2017 13:18:05 +0000 (15:18 +0200)
The test cli/007-check-force reports something like:

$ type -p '--string that starts with dashes'
bash: type: --: invalid option

Add the option/argument separator.

Signed-off-by: David Sterba <dsterba@suse.com>
tests/common

index 1c098e8..eb525a4 100644 (file)
@@ -35,7 +35,7 @@ _is_file_or_command()
        if [ -f "$msg" -o -d "$msg" -o -b "$msg" ]; then
                return 0
        fi
-       msg=$(type -p "$msg")
+       msg=$(type -p -- "$msg")
        if [ -f "$msg" ]; then
                return 0
        fi