From 34fa233c66d6595e168fe114655857f14accfa3a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 2 Oct 2016 15:09:18 -0400 Subject: parse: Ignore -- on the command line. find uses -- to indicate the end of the flags. That is, $ find -L -- -type f is allowed, but $ find -- -L -type f results in an error about an unknown predicate `-L`. This behaviour doesn't seem particularly useful -- in particular, unlike most other tools, it doesn't help you if you want to specify a filename beginning with a -. So to ensure bfs is compatible with all GNU find command lines, we just ignore -- whenever it appears. --- tests.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 5fd4a9b..63de3ee 100755 --- a/tests.sh +++ b/tests.sh @@ -367,7 +367,17 @@ function test_0065() { diff -u "$out/out.find" "$out/out.bfs" } -for i in {1..65}; do +function test_0066() { + cd "$basic" + find_diff -- -type f +} + +function test_0067() { + cd "$basic" + find_diff -L -- -type f +} + +for i in {1..67}; do test="test_$(printf '%04d' $i)" ("$test" "$dir") status=$? -- cgit v1.2.3