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

shards --help invokes install subcommand #649

Open
HertzDevil opened this issue Oct 24, 2024 · 1 comment
Open

shards --help invokes install subcommand #649

HertzDevil opened this issue Oct 24, 2024 · 1 comment

Comments

@HertzDevil
Copy link
Contributor

After #631, if the command line invocation is exactly shards --help, or it is shards --help -- followed by more arguments, then Shards behaves as if install is the selected command and ignores the --help entirely. This does not seem to be intended behavior.

@luislavena
Copy link
Contributor

luislavena commented Jan 11, 2025

Hello @HertzDevil, just noticed you submitted this issue and definitely I didn't test it properly to catch it 😢

Before #631, shards --help or shards install --help had always the same result: it listed all the commands, like no command was provided:

/app # shards --version
Shards 0.18.0 (2024-03-28)

/app # shards --help
shards [<options>...] [<command>]

Commands:
    build [<targets>] [<build_options>]  - Build the specified <targets> in `bin` path, all build_options are delegated to `crystal build`.
    check                                - Verify all dependencies are installed.
    init                                 - Initialize a `shard.yml` file.
    install                              - Install dependencies, creating or using the `shard.lock` file.
    list [--tree]                        - List installed dependencies.
    lock [--update] [<shards>...]        - Lock dependencies in `shard.lock` but doesn't install them.
    outdated [--pre]                     - List dependencies that are outdated.
    prune                                - Remove unused dependencies from `lib` folder.
    run [<target>] [<options>]           - Build and run specified target
    update [<shards>...]                 - Update dependencies and `shard.lock`.
    version [<path>]                     - Print the current version of the shard.

General options:
    --no-color                       Disable colored output.
    --version                        Print the `shards` version.
    --frozen                         Strictly installs locked versions from shard.lock.
    --without-development            Does not install development dependencies.
    --production                     same as `--frozen --without-development`
    --skip-postinstall               Does not run postinstall of dependencies
    --skip-executables               Does not install executables
    --local                          Don't update remote repositories, use the local cache only.
    --jobs=N                         Number of repository downloads to perform in parallel (default: 8). Currently only for git.
    --ignore-crystal-version         Has no effect. Kept for compatibility, to be removed in the future.
    -v, --verbose                    Increase the log verbosity, printing all debug statements.
    -q, --quiet                      Decrease the log verbosity, printing only warnings and errors.
    -h, --help                       Print usage synopsis.
/app # shards install --help
shards [<options>...] [<command>]

Commands:
    build [<targets>] [<build_options>]  - Build the specified <targets> in `bin` path, all build_options are delegated to `crystal build`.
    check                                - Verify all dependencies are installed.
    init                                 - Initialize a `shard.yml` file.
    install                              - Install dependencies, creating or using the `shard.lock` file.
    list [--tree]                        - List installed dependencies.
    lock [--update] [<shards>...]        - Lock dependencies in `shard.lock` but doesn't install them.
    outdated [--pre]                     - List dependencies that are outdated.
    prune                                - Remove unused dependencies from `lib` folder.
    run [<target>] [<options>]           - Build and run specified target
    update [<shards>...]                 - Update dependencies and `shard.lock`.
    version [<path>]                     - Print the current version of the shard.

General options:
    --no-color                       Disable colored output.
    --version                        Print the `shards` version.
    --frozen                         Strictly installs locked versions from shard.lock.
    --without-development            Does not install development dependencies.
    --production                     same as `--frozen --without-development`
    --skip-postinstall               Does not run postinstall of dependencies
    --skip-executables               Does not install executables
    --local                          Don't update remote repositories, use the local cache only.
    --jobs=N                         Number of repository downloads to perform in parallel (default: 8). Currently only for git.
    --ignore-crystal-version         Has no effect. Kept for compatibility, to be removed in the future.
    -v, --verbose                    Increase the log verbosity, printing all debug statements.
    -q, --quiet                      Decrease the log verbosity, printing only warnings and errors.
    -h, --help                       Print usage synopsis.

Perhaps we shouldn't assume install command is the default if --help is provided.

I will try to take a stab at that. Thank you for reporting it.
❤️ ❤️ ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants