Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sctp_test usage message is missing options -X and -w #43

Open
stepnem opened this issue Sep 17, 2021 · 0 comments
Open

sctp_test usage message is missing options -X and -w #43

stepnem opened this issue Sep 17, 2021 · 0 comments

Comments

@stepnem
Copy link

stepnem commented Sep 17, 2021

Likely candidates can also be found using something like the following script:

#!/bin/sh

set -e

oldpwd=$(pwd)
testdir=$(mktemp -d)
cd "$testdir"
trap 'cd "$oldpwd" && rm -rf "$testdir"' EXIT

curl -sL https://github.com/sctp/lksctp-tools/raw/master/src/apps/sctp_test.c |
  tee s_t.c |
  sed -ne '/void usage(/,/* usage() */ {s/\\[nt]//g;p}' >usage

options=$(sed -ne 's/^.*getopt([^"]*"\([^"]*\)").*$/\1/p' s_t.c).

while true; do
  option=$(printf %c "$options")
  case $option in
    :) ;;
    .) exit;;
    ?) grep -qE "(^|[^[:alnum:]_-])-$option($|[^[:alnum:]_-])" usage ||
      printf '%s\n' "$option";;
  esac
  options=${options#?}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant