Enhanced SIM for E2AP v1 for TS UC
[sim/e2-interface.git] / e2sim / e2apv1sim / tools / build_helper.bash
1 #/*****************************************************************************
2 #                                                                            *
3 # Copyright 2019 AT&T Intellectual Property                                  *
4 # Copyright 2019 Nokia                                                       *
5 #                                                                            *
6 # Licensed under the Apache License, Version 2.0 (the "License");            *
7 # you may not use this file except in compliance with the License.           *
8 # You may obtain a copy of the License at                                    *
9 #                                                                            *
10 #      http://www.apache.org/licenses/LICENSE-2.0                            *
11 #                                                                            *
12 # Unless required by applicable law or agreed to in writing, software        *
13 # distributed under the License is distributed on an "AS IS" BASIS,          *
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
15 # See the License for the specific language governing permissions and        *
16 # limitations under the License.                                             *
17 #                                                                            *
18 #******************************************************************************/
19
20 #######################################
21 #            Helper Func
22 ######################################
23
24 black='\E[30m'
25 red='\E[31m'
26 green='\E[32m'
27 yellow='\E[33m'
28 blue='\E[34m'
29 magenta='\E[35m'
30 cyan='\E[36m'
31 white='\E[37m'
32 reset_color='\E[00m'
33
34 cecho()   # Color-echo. arg1 = message, arg2 = color
35 {
36     local default_msg="No Message."
37     message=${1:-$default_msg}
38     color=${2:-$green}
39     echo -e -n "$color$message$reset_color"
40     echo
41     return
42 }
43
44 echo_error() {
45     local my_string=""
46     until [ -z "$1" ]
47     do
48         my_string="$my_string$1"
49         shift
50         done
51         cecho "$my_string" $red
52 }
53
54 echo_fatal() {
55     local my_string=""
56     until [ -z "$1" ]
57     do
58         my_string="$my_string$1"
59         shift
60         done
61         echo_error "$my_string"
62     exit -1
63 }
64
65 echo_warning() {
66     local my_string=""
67     until [ -z "$1" ]
68     do
69         my_string="$my_string$1"
70         shift
71     done
72     cecho "$my_string" $yellow
73 }
74
75 echo_success() {
76     local my_string=""
77     until [ -z "$1" ]
78     do
79         my_string="$my_string$1"
80         shift
81     done
82     cecho "$my_string" $green
83 }
84
85 echo_info() {
86     local my_string=""
87     until [ -z "$1" ]
88     do
89         my_string="$my_string$1"
90         shift
91     done
92     cecho "$my_string" $blue
93 }