Skip to content

Commit

Permalink
tools: iio: iio_generic_buffer: fix argument '?' option
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
mugunthanvnm authored and jic23 committed Sep 22, 2016
1 parent 59dc1c8 commit 44c5ba9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/iio/iio_generic_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 44c5ba9

Please sign in to comment.