Use packr_ prefix
This commit is contained in:
parent
0a83709680
commit
9c703e4039
|
@ -45,8 +45,8 @@ die() {
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
load_x "packr_handler" || die "Failed to load handler"
|
load_x "packr_handler" || die "Failed to load handler"
|
||||||
read_args "$@"
|
packr_read_args "$@"
|
||||||
check_action
|
packr_check_action
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
read_args() {
|
packr_read_args() {
|
||||||
[ -z "$1" ] && die "You must specify an argument."
|
[ -z "$1" ] && die "You must specify an argument."
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -59,7 +59,7 @@ read_args() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
print_help() {
|
packr_print_help() {
|
||||||
[ "$exitcode" = "0" ] && output="/dev/stdout" || output="/dev/stderr"
|
[ "$exitcode" = "0" ] && output="/dev/stdout" || output="/dev/stderr"
|
||||||
cat << EOF >> "$output"
|
cat << EOF >> "$output"
|
||||||
- packr: package manager -
|
- packr: package manager -
|
||||||
|
@ -81,21 +81,21 @@ EOF
|
||||||
exit "$exitcode"
|
exit "$exitcode"
|
||||||
}
|
}
|
||||||
|
|
||||||
load_core() {
|
packr_load_core() {
|
||||||
load_x "packr_cfhandler" || die "Failed to load config handler"
|
load_x "packr_cfhandler" || die "Failed to load config handler"
|
||||||
packr_conf_init || die "Failed to create configuration file"
|
packr_conf_init || die "Failed to create configuration file"
|
||||||
packr_check_vars || die "Configuration file is not proper."
|
packr_check_vars || die "Configuration file is not proper."
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_install() {
|
packr_setup_install() {
|
||||||
load_core
|
packr_load_core
|
||||||
load_x "packr_inst" || die "Failed to load packr_inst"
|
load_x "packr_inst" || die "Failed to load packr_inst"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_action() {
|
packr_check_action() {
|
||||||
case "$action" in
|
case "$action" in
|
||||||
'Install') setup_install ;;
|
'Install') packr_setup_install ;;
|
||||||
'Help') print_help "$exitcode" ;;
|
'Help') packr_print_help "$exitcode" ;;
|
||||||
'Version') printf "%s\n" "$VERSION" ;;
|
'Version') printf "%s\n" "$VERSION" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue