[v2,3/7] main: Print specific errors for invalid commands

Message ID 20180601063050.19286-4-amitay@ozlabs.org
State Superseded
Headers show
Series
  • Overhaul target selection
Related show

Commit Message

Amitay Isaacs June 1, 2018, 6:30 a.m.
This avoids large usage message obscuring the actual error message.

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 src/main.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Alistair Popple June 4, 2018, 5:09 a.m. | #1
Thank,

Reviewed-by: Alistair Popple <alistair@popple.id.au>

On Friday, 1 June 2018 4:30:46 PM AEST Amitay Isaacs wrote:
> This avoids large usage message obscuring the actual error message.
> 
> Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
> ---
>  src/main.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/main.c b/src/main.c
> index db27409..6dacd66 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -732,7 +732,6 @@ int main(int argc, char *argv[])
>  	}
>  
>  	PR_ERROR("Unsupported command: %s\n", argv[optind]);
> -	print_usage(basename(argv[0]));
>  	return 1;
>  
>  found_action:
>

Patch

diff --git a/src/main.c b/src/main.c
index db27409..6dacd66 100644
--- a/src/main.c
+++ b/src/main.c
@@ -732,7 +732,6 @@  int main(int argc, char *argv[])
 	}
 
 	PR_ERROR("Unsupported command: %s\n", argv[optind]);
-	print_usage(basename(argv[0]));
 	return 1;
 
 found_action: