2 # ==============================================================================
3 # portsreinstall library script
4 # Overlay onto lib/libcommand.sh for portsreinstall-upgrade
5 # - Operations of commands as well as check of command line arguments -
6 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
7 # This software is distributed under the 2-Clause BSD License.
8 # ==============================================================================
10 # ============= Check and parse command line arguments =============
11 command_all_parse_args ()
20 COMMAND_OPERATION=${1:-normal}
22 case $COMMAND_OPERATION in
27 _command_parse_args__chk_no_arg $#
31 _command_parse_args__chk_no_arg $#
34 _command_parse_args__chk_no_arg $#
37 message_echo "ERROR: Invalid command [$COMMAND_MODE]." >&2
41 COMMAND_SHIFT=$(($num_args_init - $#))
44 # ============= Execute command operations which do not need package tools =============
45 command_all_exec_without_pkgtools ()
50 command_exec_without_pkgtools__notify_reset_options
51 message_echo "Starting to clean up the temporary database..."
52 database_maintain_clean_all
59 # ============= Execute command operations which are irrespective of option settings =============
60 command_all_exec_irrespective_of_saved_options ()
70 # ============= Execute command operations as the main process =============
71 command_all_exec_main ()
76 command_do_ending_process