Debian Codegraph @

release_tools/handle_ltversions.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 # Created by argbash-init v2.5.0
4 # ARG_POSITIONAL_SINGLE([strategy],[<strategy's help message goes here>],[])
5 # ARGBASH_SET_DELIM([ ])
6 # ARGBASH_SET_INDENT([ ])
7 # ARG_OPTION_STACKING([none])
8 # ARG_RESTRICT_VALUES([none])
9 # ARG_TYPE_GROUP_SET([strategy],[STRATEGY],[strategy],[bugfix,backwards_compatible,breaking_change])
10 # ARG_HELP([Increment Libtool library versions in configure scripts and check that it works.])
11 # DEFINE_SCRIPT_DIR([])
12 # ARGBASH_GO()
13 # needed because of Argbash --> m4_ignore([
14 ### START OF CODE GENERATED BY Argbash v2.5.0 one line above ###
15 # Argbash is a bash code generator used to get arguments parsing right.
16 # Argbash is FREE SOFTWARE, see https://argbash.io for more info
17
18 diescip-shell shell shell-project 0.0.0 die().()
19 {
20 local _ret=$2
21 testscip-shell system . . test. -n "$_ret" || _ret=1
22 testscip-shell system . . test. "$_PRINT_HELP" = yes && print_helpscip-shell shell shell-project 0.0.0 print_help(). >&2
23 echoscip-shell system . . echo. "$1" >&2
24 exit ${_ret}
25 }
26
27 # validators
28 strategyscip-shell shell shell-project 0.0.0 strategy().()
29 {
30 local _allowed=("bugfix" "backwards_compatible" "breaking_change")
31 local _seeking="$1"
32 for element in "${_allowed[@]}"
33 do
34 testscip-shell system . . test. "$element" = "$_seeking" && echoscip-shell system . . echo. "$element" && return 0
35 done
36 diescip-shell shell shell-project 0.0.0 die(). "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'bugfix', 'backwards_compatible' and 'breaking_change'" 4
37 }
38
39 # THE DEFAULTS INITIALIZATION - POSITIONALS
40 _positionals=()
41 # THE DEFAULTS INITIALIZATION - OPTIONALS
42
43 print_helpscip-shell shell shell-project 0.0.0 print_help(). ()
44 {
45 printfscip-shell system . . printf. "%s\n" "Increment Libtool library versions in configure scripts and check that it works."
46 printfscip-shell system . . printf. 'Usage: %s [-h|--help] <strategy>\n' "$0"
47 printfscip-shell system . . printf. "\t%s\n" "<strategy>: <strategy's help message goes here>"
48 printfscip-shell system . . printf. "\t%s\n" "-h,--help: Prints help"
49 echoscip-shell system . . echo.
50 echoscip-shell system . . echo. 'Short options stacking mode is not supported.'
51 }
52
53 parse_commandlinescip-shell shell shell-project 0.0.0 parse_commandline(). ()
54 {
55 while testscip-shell system . . test. $# -gt 0
56 do
57 _key="$1"
58 case "$_key" in
59 -h|--help)
60 print_helpscip-shell shell shell-project 0.0.0 print_help().
61 exit 0
62 ;;
63 *)
64 _positionals+=("$1")
65 ;;
66 esac
67 shift
68 done
69 }
70
71
72 handle_passed_args_countscip-shell shell shell-project 0.0.0 handle_passed_args_count(). ()
73 {
74 _required_args_string="'strategy'"
75 testscip-shell system . . test. ${#_positionals[@]} -lt 1 && _PRINT_HELP=yes diescip-shell shell shell-project 0.0.0 die(). "FATAL ERROR: Not enough positional arguments - we require exactly 1 (namely: $_required_args_string), but got only ${#_positionals[@]}." 1
76 testscip-shell system . . test. ${#_positionals[@]} -gt 1 && _PRINT_HELP=yes diescip-shell shell shell-project 0.0.0 die(). "FATAL ERROR: There were spurious positional arguments --- we expect exactly 1 (namely: $_required_args_string), but got ${#_positionals[@]} (the last one was: '${_positionals[*]: -1}')." 1
77 }
78
79 assign_positional_argsscip-shell shell shell-project 0.0.0 assign_positional_args(). ()
80 {
81 _positional_names=('_arg_strategy' )
82
83 for (( ii = 0; ii < ${#_positionals[@]}; ii++))
84 do
85 eval "${_positional_names[ii]}=\${_positionals[ii]}" || die "Error during argument parsing, possibly an Argbash bug." 1
86 done
87 }
88
89 parse_commandlinescip-shell shell shell-project 0.0.0 parse_commandline(). "$@"
90 handle_passed_args_countscip-shell shell shell-project 0.0.0 handle_passed_args_count().
91 assign_positional_argsscip-shell shell shell-project 0.0.0 assign_positional_args().
92
93 # OTHER STUFF GENERATED BY Argbash
94 script_dir="$(cd "$(dirnamescip-shell system . . dirname. "${BASH_SOURCE[0]}")" && pwdscip-shell system . . pwd.)" || diescip-shell shell shell-project 0.0.0 die(). "Couldn't determine the script's running directory, which probably matters, bailing out" 2
95 # Validation of values
96 _arg_strategy="$(strategyscip-shell shell shell-project 0.0.0 strategy(). "$_arg_strategy" "strategy")" || exit 1
97
98
99 ### END OF CODE GENERATED BY Argbash (sortof) ### ])
100 # [ <-- needed because of Argbash
101
102
103 . "$script_dir/release.sh"
104
105 increment_ltversions "$_arg_strategy"
106
107 # ] <-- needed because of Argbash