]> git.ipfire.org Git - thirdparty/nftables.git/commit
main: enforce options before commands
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 13 Dec 2019 10:32:46 +0000 (11:32 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 18 Dec 2019 09:06:05 +0000 (10:06 +0100)
commitfb9cea50e8b370b6931e7b53b1a881d3b95b1c91
tree194a007ae2b989ab7488a8491d6e07d1585138c3
parent9ba5f4710fca93ae4c8c1d3cdf8c781328effbdc
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 <pablo@netfilter.org>
src/main.c
tests/shell/testcases/cache/0001_cache_handling_0
tests/shell/testcases/chains/0016delete_handle_0
tests/shell/testcases/chains/0039negative_priority_0 [new file with mode: 0755]
tests/shell/testcases/flowtable/0010delete_handle_0
tests/shell/testcases/maps/0008interval_map_delete_0
tests/shell/testcases/optionals/comments_0
tests/shell/testcases/optionals/comments_handles_0
tests/shell/testcases/optionals/delete_object_handles_0
tests/shell/testcases/optionals/handles_0
tests/shell/testcases/sets/0028delete_handle_0