awslabs / dynein

DynamoDB CLI written in Rust.
https://github.com/awslabs/dynein
Apache License 2.0
364 stars 37 forks source link

feat: add flag for developing `dy admin apply` #156

Closed wafuwafu13 closed 1 year ago

wafuwafu13 commented 1 year ago

*Issue https://github.com/awslabs/dynein/issues/155#issuecomment-1701326714

Description of changes:

During development, to eliminate the impact on users, ensure that apply only works when --dev is added.

# just return message
$ dy admin apply
not yet implemented

# develop feature
$ dy admin apply --dev
(something happen)

Now, dy admin apply --dev causes panic.

~/Desktop/dynein
$ ./target/release/dy admin apply
not yet implemented

~/Desktop/dynein
$ ./target/release/dy admin apply --dev
thread 'main' panicked at 'not yet implemented', src/main.rs:89:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

StoneDot commented 1 year ago

Thank you for trying to build new feature for dynein. I understand that you are trying to create the feature in separate multiple pull requests. I think It is a reasonable tactic.

As my quick search, I found that hidden option of structopt may work for this kind of phased development. I hope this information helps to implement more user-friendly interface even in developing phase. https://github.com/TeXitoi/structopt/issues/466

wafuwafu13 commented 1 year ago

Do not display apply subcommand in help is good idea but it is written in the README. So I want to keep --test-apply flag so that even if the user executes it, it will not affect the user.