diff --git a/usr.bin/make/unit-tests/opt.exp b/usr.bin/make/unit-tests/opt.exp index 39a9383953dd..001f91ca357f 100644 --- a/usr.bin/make/unit-tests/opt.exp +++ b/usr.bin/make/unit-tests/opt.exp @@ -1 +1,19 @@ +make -: +usage: make [-BeikNnqrstWwX] + [-C directory] [-D variable] [-d flags] [-f makefile] + [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file] + [-V variable] [-v variable] [variable=value] [target ...] +*** Error code 2 (ignored) + +make -- -VAR=value -f /dev/null +make: don't know how to make -f (continuing) +`/dev/null' is up to date. + +make -? +usage: make [-BeikNnqrstWwX] + [-C directory] [-D variable] [-d flags] [-f makefile] + [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file] + [-V variable] [-v variable] [variable=value] [target ...] +*** Error code 2 (ignored) + exit status 0 diff --git a/usr.bin/make/unit-tests/opt.mk b/usr.bin/make/unit-tests/opt.mk index eae430965df7..675c157059c9 100644 --- a/usr.bin/make/unit-tests/opt.mk +++ b/usr.bin/make/unit-tests/opt.mk @@ -1,8 +1,24 @@ -# $NetBSD: opt.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# $NetBSD: opt.mk,v 1.3 2020/11/14 17:33:51 rillig Exp $ # # Tests for the command line options. # TODO: Implementation -all: - @:; +.MAKEFLAGS: -d0 # make stdout line-buffered + +all: .IGNORE + # Just to see how the custom argument parsing code reacts to a syntax + # error. The colon is used in the options string, marking an option + # that takes arguments. It is not an option by itself, though. + ${MAKE} -: + @echo + + # See whether a '--' stops handling of command line options, like in + # standard getopt programs. Yes, it does, and it treats the '-f' as + # a target to be created. + ${MAKE} -- -VAR=value -f /dev/null + @echo + + # This is the normal way to print the usage of a command. + ${MAKE} -? + @echo