Skip to content

Commit

Permalink
iio_info: Remove -s option
Browse files Browse the repository at this point in the history
iio_info had two possible options to scan for contexts: -S (aka. --scan)
and -s, which did more or less the same thing, but -s didn't take an
argument and scanned all possible contexts.

Remove the -s option in the help text to reduce the confusion, while
still handling it for backwards-compatibility.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Feb 17, 2022
1 parent e9c8011 commit 60c33c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion man/iio_info.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ normally returned from
with no address part
.RE
.TP
.B \-s, \-\-scan
.B \-S, \-\-scan
Scan for available backends
.TP
.B \-a, \-\-auto
Expand Down
6 changes: 2 additions & 4 deletions tests/iio_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@
#endif

static const struct option options[] = {
{"scan", no_argument, 0, 's'},
{0, 0, 0, 0},
};

static const char *options_descriptions[] = {
"[-x <xml_file>]\n"
"\t\t\t\t[-u <uri>]",
"Scan for available backends.",
};

static int dev_is_buffer_capable(const struct iio_device *dev)
Expand All @@ -59,7 +57,7 @@ static int dev_is_buffer_capable(const struct iio_device *dev)
return false;
}

#define MY_OPTS "s"
#define MY_OPTS ""

int main(int argc, char **argv)
{
Expand Down Expand Up @@ -87,7 +85,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Failed to add common options\n");
return EXIT_FAILURE;
}
while ((c = getopt_long(argc, argw, "+" COMMON_OPTIONS MY_OPTS, /* Flawfinder: ignore */
while ((c = getopt_long(argc, argw, "+" COMMON_OPTIONS MY_OPTS "s", /* Flawfinder: ignore */
opts, NULL)) != -1) {
switch (c) {
/* All these are handled in the common */
Expand Down

0 comments on commit 60c33c4

Please sign in to comment.