All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: iio: iio_generic_buffer: fix argument '?' option
@ 2016-09-21 16:57 Mugunthan V N
  2016-09-22 17:47 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Mugunthan V N @ 2016-09-21 16:57 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mugunthan V N

When help ('?') option is passed to the command, the help text
printed but not from '?' switch case of getopt_long() but as a
invalid argument as below. Fix this by adding '?' to opt_String
of getopt_long().

root@am437x-evm:~# ./iio_generic_buffer -?
./iio_generic_buffer: invalid option -- '?'
Usage: generic_buffer [options]...
Capture, convert and output data from IIO device buffer
  -a         Auto-activate all available channels
...

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 tools/iio/iio_generic_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c
index f39c0e9..85e2329 100644
--- a/tools/iio/iio_generic_buffer.c
+++ b/tools/iio/iio_generic_buffer.c
@@ -352,7 +352,7 @@ int main(int argc, char **argv)
 
 	register_cleanup();
 
-	while ((c = getopt_long(argc, argv, "ac:egl:n:N:t:T:w:", longopts, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "ac:egl:n:N:t:T:w:?", longopts, NULL)) != -1) {
 		switch (c) {
 		case 'a':
 			autochannels = AUTOCHANNELS_ENABLED;
-- 
2.10.0.129.g35f6318

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools: iio: iio_generic_buffer: fix argument '?' option
  2016-09-21 16:57 [PATCH] tools: iio: iio_generic_buffer: fix argument '?' option Mugunthan V N
@ 2016-09-22 17:47 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2016-09-22 17:47 UTC (permalink / raw)
  To: Mugunthan V N, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler

On 21/09/16 17:57, Mugunthan V N wrote:
> When help ('?') option is passed to the command, the help text
> printed but not from '?' switch case of getopt_long() but as a
> invalid argument as below. Fix this by adding '?' to opt_String
> of getopt_long().
> 
> root@am437x-evm:~# ./iio_generic_buffer -?
> ./iio_generic_buffer: invalid option -- '?'
> Usage: generic_buffer [options]...
> Capture, convert and output data from IIO device buffer
>   -a         Auto-activate all available channels
> ...
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Thanks,

Applied to the togreg branch of iio.git, initially pushed
out as testing.

Jonathan
> ---
>  tools/iio/iio_generic_buffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c
> index f39c0e9..85e2329 100644
> --- a/tools/iio/iio_generic_buffer.c
> +++ b/tools/iio/iio_generic_buffer.c
> @@ -352,7 +352,7 @@ int main(int argc, char **argv)
>  
>  	register_cleanup();
>  
> -	while ((c = getopt_long(argc, argv, "ac:egl:n:N:t:T:w:", longopts, NULL)) != -1) {
> +	while ((c = getopt_long(argc, argv, "ac:egl:n:N:t:T:w:?", longopts, NULL)) != -1) {
>  		switch (c) {
>  		case 'a':
>  			autochannels = AUTOCHANNELS_ENABLED;
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-22 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 16:57 [PATCH] tools: iio: iio_generic_buffer: fix argument '?' option Mugunthan V N
2016-09-22 17:47 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.