Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicated subcommand name or alias still happens in 1.7.6 with sub tasks #1045

Closed
yudai-nkt opened this issue Jan 2, 2025 · 4 comments · Fixed by #1050
Closed

duplicated subcommand name or alias still happens in 1.7.6 with sub tasks #1045

yudai-nkt opened this issue Jan 2, 2025 · 4 comments · Fixed by #1050
Labels
bug Something isn't working
Milestone

Comments

@yudai-nkt
Copy link

When cmdx defines several tasks that have sub tasks, an error reported in #1032 is raised:

tasks:
  - name: foo
    tasks:
      - name: bar
        script: ":"
  - name: baz
    tasks:
      - name: qux
        script: ":"
$ cmdx -v
cmdx version 1.7.6 (29bca03f2177da84d24d1146fba5a8ce4c0ec9fb)
$ cmdx help
parent command [cmdx] has duplicated subcommand name or alias:

If either task has a script, this doesn't happen.

tasks:
  - name: foo
    tasks:
      - name: bar
        script: ":"
  - name: baz
    script: ":"
$ cmdx -v
cmdx version 1.7.6 (29bca03f2177da84d24d1146fba5a8ce4c0ec9fb)
$ cmdx help
NAME:
   cmdx - task runner

USAGE:
   cmdx [global options] command [command options]

VERSION:
   1.7.6 (29bca03f2177da84d24d1146fba5a8ce4c0ec9fb)

AUTHOR:
   Shunsuke Suzuki

COMMANDS:
   foo,
   baz
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config value, -c value       configuration file path [$CMDX_CONFIG_PATH]
   --name value, -n value         configuration file name. The configuration file is searched from the current directory to the root directory recursively
   --working-dir value, -w value  The working directory path. By default, the task is run on the directory where the configuration file is found [$CMDX_WORKING_DIR]
   --init, -i                     create the configuration file (default: false)
   --list, -l                     list tasks (default: false)
   --quiet, -q                    don't output the executed command (default: false)
   --dry-run, -d                  output the script but don't run it actually (default: false)
   --help, -h                     show help
   --version, -v                  print the version
@suzuki-shunsuke
Copy link
Owner

Thank you for reporting this issue.
I'll take a look.

@suzuki-shunsuke
Copy link
Owner

Thank you.
This is a bug of cmdx.
I missed the case of sub tasks.

@suzuki-shunsuke
Copy link
Owner

🎉 https://github.com/suzuki-shunsuke/cmdx/releases/tag/v1.7.7

@suzuki-shunsuke suzuki-shunsuke added this to the v1.7.7 milestone Jan 2, 2025
@yudai-nkt
Copy link
Author

Wow, the response was so quick! Thanks for the fix and cmdx itself (I love the ergonomics of how cmdx handles flag compared to other task runners).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants