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

Move Shelley commands to the top-lvl and deprecate "shelley" subcommand #2076

Merged
merged 1 commit into from Nov 23, 2020

Conversation

intricate
Copy link
Contributor

This PR moves Shelley-related commands from under the "shelley" subcommand to the top-level of the CLI.

We still maintain support for the "shelley" subcommand (i.e. all of the commands still work), but its help text is hidden. However, the help text can still be accessed by running cardano-cli shelley or cardano-cli shelley --help:

$ cardano-cli shelley
Usage: cardano-cli shelley COMMAND
  Shelley specific commands (deprecated)

Available options:
  -h,--help                Show this help text

Available commands:
  ...

Additionally, a warning message is written to stderr when one attempts to run a command under the "shelley" subcommand. Example:

$ cardano-cli shelley address key-gen --verification-key-file /dev/null --signing-key-file /dev/null
WARNING: The "shelley" subcommand is now deprecated and will be removed in the future. Please use the top-level commands instead.

@intricate intricate force-pushed the intricate/deprecate-shelley-subcmd branch from a4661aa to 7b8d432 Compare November 10, 2020 19:25
@Jimbo4350
Copy link
Contributor

Jimbo4350 commented Nov 11, 2020

We should also think about how we are going to update the cli tests.

-- the provided 'ExceptT'.
ioExceptTWithWarning :: MonadIO m => Text -> ExceptT e m () -> ExceptT e m ()
ioExceptTWithWarning warningMsg e =
liftIO (Text.hPutStrLn stderr warningMsg) >> e
Copy link
Contributor

@Jimbo4350 Jimbo4350 Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally wouldn't bother with defining two new functions, seems verbose when
liftIO (Text.hPutStrLn stderr warningMsg) >> e on its own would do with a comment. Your call though!

Copy link
Contributor Author

@intricate intricate Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was considering reusing this for other deprecated commands/arguments.

For example, after #1979 is merged, I'm considering whether we should print deprecation warnings when hex or TextEnvelope keys are specified.

@intricate intricate force-pushed the intricate/deprecate-shelley-subcmd branch from 2eedb24 to fc43c20 Compare November 16, 2020 16:01
@intricate intricate self-assigned this Nov 17, 2020
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dcoutts
Copy link
Contributor

dcoutts commented Nov 23, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Nov 23, 2020
2076: Move Shelley commands to the top-lvl and deprecate "shelley" subcommand r=dcoutts a=intricate

This PR moves Shelley-related commands from under the "shelley" subcommand to the top-level of the CLI.

We still maintain support for the "shelley" subcommand (i.e. all of the commands still work), but its help text is hidden. However, the help text can still be accessed by running `cardano-cli shelley` or `cardano-cli shelley --help`:

```
$ cardano-cli shelley
Usage: cardano-cli shelley COMMAND
  Shelley specific commands (deprecated)

Available options:
  -h,--help                Show this help text

Available commands:
  ...
```

Additionally, a warning message is written to `stderr` when one attempts to run a command under the "shelley" subcommand. Example:

```
$ cardano-cli shelley address key-gen --verification-key-file /dev/null --signing-key-file /dev/null
WARNING: The "shelley" subcommand is now deprecated and will be removed in the future. Please use the top-level commands instead.
```

Co-authored-by: Luke Nadur <19835357+intricate@users.noreply.github.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 23, 2020

Timed out.

@intricate
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 23, 2020

@iohk-bors iohk-bors bot merged commit 132a440 into master Nov 23, 2020
@iohk-bors iohk-bors bot deleted the intricate/deprecate-shelley-subcmd branch November 23, 2020 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants