@@ -6,33 +6,33 @@ Core functions for any Bash program
6
6
7
7
## Index
8
8
9
- * [ core.trap_add() ] ( #coretrap_add )
10
- * [ core.trap_remove() ] ( #coretrap_remove )
11
- * [ core.shopt_push() ] ( #coreshopt_push )
12
- * [ core.shopt_pop() ] ( #coreshopt_pop )
13
- * [ core.err_set() ] ( #coreerr_set )
14
- * [ core.err_clear() ] ( #coreerr_clear )
15
- * [ core.err_exists() ] ( #coreerr_exists )
16
- * [ core.panic() ] ( #corepanic )
17
- * [ core.print_stacktrace() ] ( #coreprint_stacktrace )
18
- * [ core.print_fatal_fn() ] ( #coreprint_fatal_fn )
19
- * [ core.print_error_fn() ] ( #coreprint_error_fn )
20
- * [ core.print_warn_fn() ] ( #coreprint_warn_fn )
21
- * [ core.print_info_fn() ] ( #coreprint_info_fn )
22
- * [ core.print_debug_fn() ] ( #coreprint_debug_fn )
23
- * [ core.print_fatal() ] ( #coreprint_fatal )
24
- * [ core.print_error() ] ( #coreprint_error )
25
- * [ core.print_warn() ] ( #coreprint_warn )
26
- * [ core.print_info() ] ( #coreprint_info )
27
- * [ core.print_debug() ] ( #coreprint_debug )
28
- * [ core.should_output_color() ] ( #coreshould_output_color )
29
- * [ core.get_package_info() ] ( #coreget_package_info )
30
- * [ core.init() ] ( #coreinit )
31
- * [ core.stacktrace_print() ] ( #corestacktrace_print )
32
- * [ core.print_die_fn() ] ( #coreprint_die_fn )
33
- * [ core.print_die() ] ( #coreprint_die )
34
-
35
- ### core.trap_add()
9
+ * [ core.trap_add] ( #coretrap_add )
10
+ * [ core.trap_remove] ( #coretrap_remove )
11
+ * [ core.shopt_push] ( #coreshopt_push )
12
+ * [ core.shopt_pop] ( #coreshopt_pop )
13
+ * [ core.err_set] ( #coreerr_set )
14
+ * [ core.err_clear] ( #coreerr_clear )
15
+ * [ core.err_exists] ( #coreerr_exists )
16
+ * [ core.panic] ( #corepanic )
17
+ * [ core.print_stacktrace] ( #coreprint_stacktrace )
18
+ * [ core.print_fatal_fn] ( #coreprint_fatal_fn )
19
+ * [ core.print_error_fn] ( #coreprint_error_fn )
20
+ * [ core.print_warn_fn] ( #coreprint_warn_fn )
21
+ * [ core.print_info_fn] ( #coreprint_info_fn )
22
+ * [ core.print_debug_fn] ( #coreprint_debug_fn )
23
+ * [ core.print_fatal] ( #coreprint_fatal )
24
+ * [ core.print_error] ( #coreprint_error )
25
+ * [ core.print_warn] ( #coreprint_warn )
26
+ * [ core.print_info] ( #coreprint_info )
27
+ * [ core.print_debug] ( #coreprint_debug )
28
+ * [ core.should_output_color] ( #coreshould_output_color )
29
+ * [ core.get_package_info] ( #coreget_package_info )
30
+ * [ core.init] ( #coreinit )
31
+ * [ core.stacktrace_print] ( #corestacktrace_print )
32
+ * [ core.print_die_fn] ( #coreprint_die_fn )
33
+ * [ core.print_die] ( #coreprint_die )
34
+
35
+ ### core.trap_add
36
36
37
37
Adds a handler for a particular ` trap ` signal or event. Noticably,
38
38
unlike the 'builtin' trap, this does not override any other existing handlers. The first argument
@@ -52,7 +52,7 @@ core.trap_remove 'some_handler' 'USR1'
52
52
* ** $1** (string): Function to execute on an event. Integers are forbiden
53
53
* ** $2** (string): Event signal
54
54
55
- ### core.trap_remove()
55
+ ### core.trap_remove
56
56
57
57
Removes a handler for a particular ` trap ` signal or event. Currently,
58
58
if the function doest not exist, it prints an error
@@ -71,7 +71,7 @@ core.trap_remove 'some_handler' 'USR1'
71
71
* ** $1** (string): Function to remove
72
72
* ** $2** (string): Signal that the function executed on
73
73
74
- ### core.shopt_push()
74
+ ### core.shopt_push
75
75
76
76
Modifies current shell options and pushes information to stack, so
77
77
it can later be easily undone. Note that it does not check to see if your Bash
@@ -90,7 +90,7 @@ core.shopt_pop
90
90
* ** $1** (string): Name of shopt action. Can either be ` -u ` or ` -s `
91
91
* ** $2** (string): Name of shopt name
92
92
93
- ### core.shopt_pop()
93
+ ### core.shopt_pop
94
94
95
95
Modifies current shell options based on most recent item added to stack.
96
96
@@ -104,7 +104,7 @@ core.shopt_pop
104
104
105
105
_ Function has no arguments._
106
106
107
- ### core.err_set()
107
+ ### core.err_set
108
108
109
109
Sets an error.
110
110
@@ -118,7 +118,7 @@ Sets an error.
118
118
* ** number** (ERRCODE): Error code
119
119
* ** string** (ERR): Error message
120
120
121
- ### core.err_clear()
121
+ ### core.err_clear
122
122
123
123
Clears any of the global error state (sets to empty string).
124
124
This means any ` core.err_exists ` calls after this _ will_ ` return 1 `
@@ -130,18 +130,18 @@ _Function has no arguments._
130
130
* ** number** (ERRCODE): Error code
131
131
* ** string** (ERR): Error message
132
132
133
- ### core.err_exists()
133
+ ### core.err_exists
134
134
135
135
Checks if an error exists. If ` ERR ` is not empty, then an error
136
136
_ does_ exist
137
137
138
138
_ Function has no arguments._
139
139
140
- ### core.panic()
140
+ ### core.panic
141
141
142
142
Use when a serious fault occurs. It will print the current ERR (if it exists)
143
143
144
- ### core.print_stacktrace()
144
+ ### core.print_stacktrace
145
145
146
146
Prints stacktrace
147
147
@@ -160,7 +160,7 @@ core.trap_add 'err_handler' ERR
160
160
161
161
_ Function has no arguments._
162
162
163
- ### core.print_fatal_fn()
163
+ ### core.print_fatal_fn
164
164
165
165
Print a fatal error message including the function name of the callee
166
166
to standard error
@@ -169,7 +169,7 @@ to standard error
169
169
170
170
* ** $1** (string): message
171
171
172
- ### core.print_error_fn()
172
+ ### core.print_error_fn
173
173
174
174
Print an error message including the function name of the callee
175
175
to standard error
@@ -178,7 +178,7 @@ to standard error
178
178
179
179
* ** $1** (string): message
180
180
181
- ### core.print_warn_fn()
181
+ ### core.print_warn_fn
182
182
183
183
Print a warning message including the function name of the callee
184
184
to standard error
@@ -187,7 +187,7 @@ to standard error
187
187
188
188
* ** $1** (string): message
189
189
190
- ### core.print_info_fn()
190
+ ### core.print_info_fn
191
191
192
192
Print an informative message including the function name of the callee
193
193
to standard output
@@ -196,7 +196,7 @@ to standard output
196
196
197
197
* ** $1** (string): message
198
198
199
- ### core.print_debug_fn()
199
+ ### core.print_debug_fn
200
200
201
201
Print a debug message including the function name of the callee
202
202
to standard output
@@ -205,53 +205,53 @@ to standard output
205
205
206
206
* ** $1** (string): message
207
207
208
- ### core.print_fatal()
208
+ ### core.print_fatal
209
209
210
210
Print a fatal error message to standard error
211
211
212
212
#### Arguments
213
213
214
214
* ** $1** (string): message
215
215
216
- ### core.print_error()
216
+ ### core.print_error
217
217
218
218
Print an error message to standard error
219
219
220
220
#### Arguments
221
221
222
222
* ** $1** (string): message
223
223
224
- ### core.print_warn()
224
+ ### core.print_warn
225
225
226
226
Print a warning message to standard error
227
227
228
228
#### Arguments
229
229
230
230
* ** $1** (string): message
231
231
232
- ### core.print_info()
232
+ ### core.print_info
233
233
234
234
Print an informative message to standard output
235
235
236
236
#### Arguments
237
237
238
238
* ** $1** (string): message
239
239
240
- ### core.print_debug()
240
+ ### core.print_debug
241
241
242
242
Print a debug message to standard output if the environment variable "DEBUG" is present
243
243
244
244
#### Arguments
245
245
246
246
* ** $1** (string): message
247
247
248
- ### core.should_output_color()
248
+ ### core.should_output_color
249
249
250
250
(DEPRECATED). Determine if color should be printed. Note that this doesn't
251
251
use tput because simple environment variable checking heuristics suffice. Deprecated because this code
252
252
has been moved to bash-std
253
253
254
- ### core.get_package_info()
254
+ ### core.get_package_info
255
255
256
256
(DEPRECATED) Gets information from a particular package. If the key does not exist, then the value
257
257
is an empty string. Deprecated as this code has been moved to bash-std
@@ -264,22 +264,22 @@ is an empty string. Deprecated as this code has been moved to bash-std
264
264
265
265
* ** directory** (string): The full path to the directory
266
266
267
- ### core.init()
267
+ ### core.init
268
268
269
269
(DEPRECATED) Initiates global variables used by other functions. Deprecated as
270
270
this function is called automatically by functions that use global variables
271
271
272
272
_ Function has no arguments._
273
273
274
- ### core.stacktrace_print()
274
+ ### core.stacktrace_print
275
275
276
276
(DEPRECATED) Prints stacktrace
277
277
278
278
#### See also
279
279
280
280
* [ core.print_stacktrace] ( #coreprint_stacktrace )
281
281
282
- ### core.print_die_fn()
282
+ ### core.print_die_fn
283
283
284
284
(DEPRECATED) Print a error message to standard error including the function name
285
285
of the callee to standard error and die
@@ -288,7 +288,7 @@ of the callee to standard error and die
288
288
289
289
* ** $1** (string): message
290
290
291
- ### core.print_die()
291
+ ### core.print_die
292
292
293
293
(DEPRECATED) Print a error message to standard error and die
294
294
0 commit comments