From fb9cea50e8b370b6931e7b53b1a881d3b95b1c91 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 13 Dec 2019 11:32:46 +0100 Subject: main: enforce options before commands This patch turns on POSIXLY_CORRECT on the getopt parser to enforce options before commands. Users get a hint in such a case: # nft list ruleset -a Error: syntax error, options must be specified before commands nft list ruleset -a ^ ~~ This patch recovers 9fc71bc6b602 ("main: Fix for misleading error with negative chain priority"). Tests have been updated. Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/sets/0028delete_handle_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/shell/testcases/sets') diff --git a/tests/shell/testcases/sets/0028delete_handle_0 b/tests/shell/testcases/sets/0028delete_handle_0 index 4e8b3228..5ad17c22 100755 --- a/tests/shell/testcases/sets/0028delete_handle_0 +++ b/tests/shell/testcases/sets/0028delete_handle_0 @@ -7,7 +7,7 @@ $NFT add set test-ip y { type inet_service \; timeout 3h45s \;} $NFT add set test-ip z { type ipv4_addr\; flags constant , interval\;} $NFT add set test-ip c {type ipv4_addr \; flags timeout \; elements={192.168.1.1 timeout 10s, 192.168.1.2 timeout 30s} \;} -set_handle=$($NFT list ruleset -a | awk '/set c/{print $NF}') +set_handle=$($NFT -a list ruleset | awk '/set c/{print $NF}') $NFT delete set test-ip handle $set_handle EXPECTED="table ip test-ip { -- cgit v1.2.3