1c67d6573Sopenharmony_ci#!/bin/bash
2c67d6573Sopenharmony_ci
3c67d6573Sopenharmony_ciusage() {
4c67d6573Sopenharmony_ci  echo "Usage: $(basename $0) [rust | rust-bytes | pcre1 | pcre2 | re2 | onig | tcl ]" >&2
5c67d6573Sopenharmony_ci  exit 1
6c67d6573Sopenharmony_ci}
7c67d6573Sopenharmony_ci
8c67d6573Sopenharmony_ciif [ $# = 0 ] || [ $1 = '-h' ] || [ $1 = '--help' ]; then
9c67d6573Sopenharmony_ci  usage
10c67d6573Sopenharmony_cifi
11c67d6573Sopenharmony_ci
12c67d6573Sopenharmony_ciwhich="$1"
13c67d6573Sopenharmony_cishift
14c67d6573Sopenharmony_cicase $which in
15c67d6573Sopenharmony_ci  rust)
16c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-rust "$@"
17c67d6573Sopenharmony_ci    ;;
18c67d6573Sopenharmony_ci  rust-bytes)
19c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-rust-bytes "$@"
20c67d6573Sopenharmony_ci    ;;
21c67d6573Sopenharmony_ci  re2)
22c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-re2 "$@"
23c67d6573Sopenharmony_ci    ;;
24c67d6573Sopenharmony_ci  pcre1)
25c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-pcre1 "$@"
26c67d6573Sopenharmony_ci    ;;
27c67d6573Sopenharmony_ci  pcre2)
28c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-pcre2 "$@"
29c67d6573Sopenharmony_ci    ;;
30c67d6573Sopenharmony_ci  onig)
31c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-onig "$@"
32c67d6573Sopenharmony_ci    ;;
33c67d6573Sopenharmony_ci  tcl)
34c67d6573Sopenharmony_ci    exec cargo bench --bench bench --features re-tcl "$@"
35c67d6573Sopenharmony_ci    ;;
36c67d6573Sopenharmony_ci  *)
37c67d6573Sopenharmony_ci    usage
38c67d6573Sopenharmony_ci    ;;
39c67d6573Sopenharmony_ciesac
40