[PATCH] weston-launch: Handle invalid command line options

Tom Hochstein tom.hochstein at nxp.com
Wed May 18 13:12:26 UTC 2016


Sorry, my commit message could have been clearer. The command does already print an 'unrecognized option' message. What's changed with this patch is we exit on error.

Tom

-----Original Message-----
From: Jonas Ã…dahl [mailto:jadahl at gmail.com] 
Sent: Tuesday, May 17, 2016 1:35 AM
To: Yong Bakos <junk at humanoriented.com>
Cc: Otavio Salvador <otavio at ossystems.com.br>; wayland-devel at lists.freedesktop.org; Tom Hochstein <tom.hochstein at nxp.com>
Subject: Re: [PATCH] weston-launch: Handle invalid command line options

On Mon, May 16, 2016 at 12:43:37PM -0600, Yong Bakos wrote:
> On May 7, 2016, at 5:57 AM, Otavio Salvador <otavio at ossystems.com.br> wrote:
> > 
> > From: Tom Hochstein <tom.hochstein at nxp.com>
> > 
> > Exit the program if an unrecognized command line option is found.
> > 
> > Signed-off-by; Tom Hochstein <tom.hochstein at nxp.com>
> > Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> 
> Simple enough of a review, and I did test this. But the question is 
> whether we want weston-launch to ignore invalid options or to quit in 
> the event of their presence. I'm not experienced enough to judge, so 
> others will have to chime in. So fwiw,

IMHO, it should at least print an error message, or the usage one line doc, before exiting.

Jonas

> 
> Reviewed-by: Yong Bakos <ybakos at humanoriented.com>
> Tested-by: Yong Bakos <ybakos at humanoriented.com>
> 
> yong
> 
> 
> > ---
> > 
> > src/weston-launch.c | 2 ++
> > 1 file changed, 2 insertions(+)
> > 
> > diff --git a/src/weston-launch.c b/src/weston-launch.c index 
> > b8dfb17..9987d8e 100644
> > --- a/src/weston-launch.c
> > +++ b/src/weston-launch.c
> > @@ -703,6 +703,8 @@ main(int argc, char *argv[])
> > 		case 'h':
> > 			help("weston-launch");
> > 			exit(EXIT_FAILURE);
> > +		default:
> > +			exit(EXIT_FAILURE);
> > 		}
> > 	}
> > 
> > --
> > 2.8.2
> > 
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list