OSDN Git Service

[IMPROVED] Adapt to the specification change of pkg-create(8) that the default extens...
[portsreinstall/current.git] / lib / libcommand.sh
index 6aa0bfa..8065929 100644 (file)
@@ -2,7 +2,7 @@
 # ==============================================================================
 # portsreinstall library script
 # - Interface of libraries for operations of commands as well as check of command line arguments -
-# Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2018-2021 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
 # This software is distributed under the 2-Clause BSD License.
 # ==============================================================================
 
@@ -30,7 +30,7 @@ command_all_chk_need_opening_notice ()
 _command_parse_args__chk_glob_args ()
 {
        local nargs
-       nargs=1
+       nargs=$1
        [ $nargs -gt 0 ] && return
        message_echo "ERROR: No port glob is specified." >&2
        exit 1
@@ -61,6 +61,7 @@ command_all_parse_args ()
 # ============= Notify that option settings are reset =============
 command_exec_without_pkgtools__notify_reset_options ()
 {
+       [ $opt_no_opening_message = yes ] && return
        message_echo "NOTE: Option settings are ignored (because of no effect) and reset."
 }
 
@@ -82,13 +83,25 @@ command_all_exec_irrespective_of_saved_options ()
 {
 }
 
+# ============= Execute command operations which should be carried out just after completing the option settings =============
+command_all_exec_just_after_option_settings ()
+{
+       shift || :
+       case $COMMAND_MODE in
+       options )
+               options_show_all
+               exit
+               ;;
+       esac
+}
+
 # ============= Execute command operations which should be done without upgrade of tools =============
 command_all_exec_before_tools_upgrade ()
 {
 }
 
 # ============= Execute command operations which must be done before the database construction =============
-command_all_exec_before_build_database ()
+command_all_exec_command_specific_preconfiguration ()
 {
 }