From 127f80691f96b573db633c7dfe9fc36006dd6979 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 29 Oct 2011 01:15:34 +0100 Subject: Move argument parsing to sub-command functions Instead of doing most of the argument parsing in parse_cmdline(), find the sub-command and (if required) the device name in main() and do the rest in the sub-command handler function. Pass argc and argp around in struct cmd_context. This also tightens up argument parsing slightly: extraneous or missing arguments will now result in an error in a few cases where they were previously ignored. All test cases now pass. Replace sub-command dispatch in doit() with a function pointer in struct option. Signed-off-by: Ben Hutchings --- ethtool.8.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethtool.8.in') diff --git a/ethtool.8.in b/ethtool.8.in index 3304fe5..7c39629 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -252,11 +252,11 @@ ethtool \- query or control network driver and hardware settings .HP .B ethtool \-n .I devname -.RB [ rx\-flow\-hash \ \*(FL] +.BR rx\-flow\-hash \ \*(FL .HP .B ethtool \-N .I devname -.RB [ rx\-flow\-hash \ \*(FL \: \*(HO] +.BR rx\-flow\-hash \ \*(FL \: \*(HO .HP .B ethtool \-w|\-\-get\-dump .I devname -- cgit v1.2.1