Skip to content

Commit 50565ab

Browse files
committed
docs: Move deprecated functions to bottom
1 parent d4e9cf2 commit 50565ab

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

docs/api.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,21 @@ Core functions for any Bash program
66

77
## Index
88

9-
* [core.init()](#coreinit)
109
* [core.trap_add()](#coretrap_add)
1110
* [core.trap_remove()](#coretrap_remove)
1211
* [core.shopt_push()](#coreshopt_push)
1312
* [core.shopt_pop()](#coreshopt_pop)
1413
* [core.err_set()](#coreerr_set)
1514
* [core.err_clear()](#coreerr_clear)
1615
* [core.err_exists()](#coreerr_exists)
17-
* [core.stacktrace_print()](#corestacktrace_print)
1816
* [core.print_stacktrace()](#coreprint_stacktrace)
1917
* [core.print_error()](#coreprint_error)
2018
* [core.print_warn()](#coreprint_warn)
2119
* [core.print_info()](#coreprint_info)
2220
* [core.should_output_color()](#coreshould_output_color)
2321
* [core.get_package_info()](#coreget_package_info)
24-
25-
### core.init()
26-
27-
(DEPRECATED) Initiates global variables used by other functions. Deprecated as this function is called automatically
28-
29-
_Function has no arguments._
22+
* [core.init()](#coreinit)
23+
* [core.stacktrace_print()](#corestacktrace_print)
3024

3125
### core.trap_add()
3226

@@ -132,14 +126,6 @@ _does_ exist
132126

133127
_Function has no arguments._
134128

135-
### core.stacktrace_print()
136-
137-
(DEPRECATED) Prints stacktrace
138-
139-
#### See also
140-
141-
* [core.print_stacktrace](#coreprint_stacktrace)
142-
143129
### core.print_stacktrace()
144130

145131
Prints stacktrace
@@ -199,3 +185,18 @@ is an empty string
199185

200186
* **REPLY** (string): The full path to the directory
201187

188+
### core.init()
189+
190+
(DEPRECATED) Initiates global variables used by other functions. Deprecated as
191+
this function is called automatically by functions that use global variables
192+
193+
_Function has no arguments._
194+
195+
### core.stacktrace_print()
196+
197+
(DEPRECATED) Prints stacktrace
198+
199+
#### See also
200+
201+
* [core.print_stacktrace](#coreprint_stacktrace)
202+

pkg/src/public/bash-core.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
# @name bash-core
44
# @description Core functions for any Bash program
55

6-
# @description (DEPRECATED) Initiates global variables used by other functions. Deprecated as this function is called automatically
7-
# @noargs
8-
core.init() {
9-
core.util.init
10-
}
11-
126
# @description Adds a handler for a particular `trap` signal or event. Noticably,
137
# unlike the 'builtin' trap, this does not override any other existing handlers
148
# @arg $1 string Function to execute on an event. Integers are forbiden
@@ -269,13 +263,6 @@ core.err_exists() {
269263
fi
270264
}
271265

272-
# @description (DEPRECATED) Prints stacktrace
273-
# @see core.print_stacktrace
274-
core.stacktrace_print() {
275-
core.print_warn "The function 'core.stacktrace_print' is deprecated in favor of 'core.print_stacktrace'"
276-
core.print_stacktrace "$@"
277-
}
278-
279266
# @description Prints stacktrace
280267
# @noargs
281268
# @example
@@ -395,3 +382,17 @@ core.get_package_info() {
395382
fi
396383
done < "$toml_file"; unset -v line
397384
}
385+
386+
# @description (DEPRECATED) Initiates global variables used by other functions. Deprecated as
387+
# this function is called automatically by functions that use global variables
388+
# @noargs
389+
core.init() {
390+
core.util.init
391+
}
392+
393+
# @description (DEPRECATED) Prints stacktrace
394+
# @see core.print_stacktrace
395+
core.stacktrace_print() {
396+
core.print_warn "The function 'core.stacktrace_print' is deprecated in favor of 'core.print_stacktrace'"
397+
core.print_stacktrace "$@"
398+
}

0 commit comments

Comments
 (0)