quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

list-identifiers.sh (1294B)


      1 #!/bin/bash
      2 #
      3 # Create a file named identifiers containing identifiers from internal header
      4 # files, based on the --internal flag.
      5 # Outputs the line count of the file to stdout.
      6 # A very thin wrapper around list_internal_identifiers.py for backwards
      7 # compatibility.
      8 # Must be run from Mbed TLS root.
      9 #
     10 # Usage: list-identifiers.sh [ -i | --internal ]
     11 #
     12 # Copyright The Mbed TLS Contributors
     13 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
     14 
     15 set -eu
     16 
     17 if [ -d include/mbedtls ]; then :; else
     18     echo "$0: Must be run from Mbed TLS root" >&2
     19     exit 1
     20 fi
     21 
     22 INTERNAL=""
     23 
     24 until [ -z "${1-}" ]
     25 do
     26   case "$1" in
     27     -i|--internal)
     28       INTERNAL="1"
     29       ;;
     30     *)
     31       # print error
     32       echo "Unknown argument: '$1'"
     33       exit 1
     34       ;;
     35   esac
     36   shift
     37 done
     38 
     39 if [ $INTERNAL ]
     40 then
     41     tests/scripts/list_internal_identifiers.py
     42     wc -l identifiers
     43 else
     44     cat <<EOF
     45 Sorry, this script has to be called with --internal.
     46 
     47 This script exists solely for backwards compatibility with the previous
     48 iteration of list-identifiers.sh, of which only the --internal option remains in
     49 use. It is a thin wrapper around list_internal_identifiers.py.
     50 
     51 check-names.sh, which used to depend on this script, has been replaced with
     52 framework/scripts/check_names.py and is now self-complete.
     53 EOF
     54 fi