Browse Source

Use help as default last level

Ernesto Nicolás Carrea 5 năm trước cách đây
mục cha
commit
4ff0398c28
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      bin/hestia

+ 6 - 0
bin/hestia

@@ -40,6 +40,7 @@ hestia() {
                 cmd_name=$arg
                 cmd_name=$arg
                 cmd_file=$arg
                 cmd_file=$arg
             fi
             fi
+            cmd_type='dir'
             shift
             shift
         elif [ -x "$HESTIA_BIN/$cmd_file/${arg}" ]; then
         elif [ -x "$HESTIA_BIN/$cmd_file/${arg}" ]; then
             # Look for regular executable file
             # Look for regular executable file
@@ -117,6 +118,11 @@ hestia() {
         if [ "$cmd_type" = 'include' ]; then
         if [ "$cmd_type" = 'include' ]; then
             source $cmd_file
             source $cmd_file
             hestia_$cmd_name $@
             hestia_$cmd_name $@
+        elif [ "$cmd_type" = 'dir' ]; then
+            # Found to dir level, but no file. Assume 'help' command
+            source "$HESTIA_BIN/${cmd_file}/help.inc"
+            cmd_name_help="${cmd_name}_help"
+            hestia_$cmd_name_help
         else
         else
             $cmd_file $@
             $cmd_file $@
         fi
         fi