go-script-bash icon indicating copy to clipboard operation
go-script-bash copied to clipboard

@go.show_subcommands returns only subcommands from the first command

Open nkakouros opened this issue 7 years ago • 1 comments

Due diligence

  • [x] I am familiar with the "Reporting issues" section of CONTRIBUTING.md
  • [x] I have searched the existing issues and haven't found one that matches what I'm reporting or requesting now.
  • [x] If this is a bug report, I have searched the Bash changelog for information that may explain or provide clues to the behavior I'm observing and reference it in the body of the report.

Framework, Bash, and operating system version information

_GO_CORE_VERSION:         v1.7.0
BASH_VERSION:             4.4.12(1)-release
OSTYPE:                   linux-gnu
_GO_PLATFORM_ID:          arch
_GO_PLATFORM_VERSION_ID:  

Description

Given a script structure like this:

scripts/
  command
  command.d/
    subcommand1
    subcommand2
    subcommand2.d/
      subsub1
      subsub2

adding:

. "$_GO_USE_MODULES" 'subcommands'                            
@go.show_subcommands

to subcommand2 will print:

Available subcommands of "subcommand2" are:

subcommand1   No description available
subcommand2   No description available

when

Available subcommands of "subcommand2" are:

subsub1   No description available
subsub2   No description available

should be printed.

The reason seems to be that @go.show_subcommands uses the $_GO_CMD_NAME to find the subcommands.

nkakouros avatar Jan 22 '18 14:01 nkakouros

+1

shafiqalibhai avatar Aug 02 '18 13:08 shafiqalibhai