blob: 4ccac236e21201dda02c21562703d0ffef78bf99 [file] [log] [blame]
Yuto Takanoac72fac2021-08-10 15:09:16 +01001#!/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
Dave Rodgman16799db2023-11-02 19:47:20 +000013# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Yuto Takanoac72fac2021-08-10 15:09:16 +010014
15set -eu
16
17if [ -d include/mbedtls ]; then :; else
18 echo "$0: Must be run from Mbed TLS root" >&2
19 exit 1
20fi
21
22INTERNAL=""
23
24until [ -z "${1-}" ]
25do
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
37done
38
39if [ $INTERNAL ]
40then
41 tests/scripts/list_internal_identifiers.py
42 wc -l identifiers
43else
44 cat <<EOF
45Sorry, this script has to be called with --internal.
46
Yuto Takano8246eb82021-08-16 10:37:24 +010047This script exists solely for backwards compatibility with the previous
48iteration of list-identifiers.sh, of which only the --internal option remains in
49use. It is a thin wrapper around list_internal_identifiers.py.
Yuto Takanoac72fac2021-08-10 15:09:16 +010050
51check-names.sh, which used to depend on this script, has been replaced with
52check_names.py and is now self-complete.
53EOF
Yuto Takanod73cec12021-08-10 15:45:28 +010054fi