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