fermyon / cloud-plugin

A Spin plugin for the Spin CLI for managing Spin apps in Fermyon Cloud.
https://developer.fermyon.com/cloud/
Apache License 2.0
8 stars 13 forks source link

spin cloud apps list --help for --V, --version is confusing #83

Closed mikkelhegn closed 1 year ago

mikkelhegn commented 1 year ago

Given the help text below, I would have expected the command to give me the version of the app, not the version of the plugin.

> spin cloud apps list --help
spin-cloud-apps-list 0.2.0 (df0e822 2023-09-13)
List all the apps deployed in Fermyon Cloud

USAGE:
    spin cloud apps list [OPTIONS]

OPTIONS:
        --environment-name <environment-name>
            Deploy to the Fermyon instance saved under the specified name. If omitted, Spin deploys
            to the default unnamed instance [env: FERMYON_DEPLOYMENT_ENVIRONMENT=]

    -h, --help
            Print help information

    -V, --version
            Print version information

> spin cloud apps list -V
spin-cloud-apps-list 0.2.0 (df0e822 2023-09-13)
itowlson commented 1 year ago

At a technical level, this occurs because the cloud plugin sets the Clap propagate_version option which cascades the version to every subcommand.

https://github.com/fermyon/cloud-plugin/blob/78c325a49d5421ab90c6d041d030c85e0cbb90ab/src/main.rs#L26

Removing the line removes the -V option from subcommands.

This is an easy fix - but the line seems to have been in from the beginning, and we should check with the original authors whether it was an intentional choice and if removing it could cause problems.