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

feat: enable global flag for all commands/options #1875

Merged
merged 3 commits into from
Apr 24, 2024
Merged

Conversation

lambda-0x
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.29%. Comparing base (77df165) to head (6fac8a5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1875      +/-   ##
==========================================
+ Coverage   70.28%   70.29%   +0.01%     
==========================================
  Files         313      313              
  Lines       35729    35769      +40     
==========================================
+ Hits        25111    25144      +33     
- Misses      10618    10625       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kariy kariy left a comment

Choose a reason for hiding this comment

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

does this change anything on how we can use the flags ? i believe global flags only propagate downwards tho.

if we want to have it global, we have to declare the options on the same or higher level than the commands themselves

@glihm
Copy link
Collaborator

glihm commented Apr 24, 2024

does this change anything on how we can use the flags ? i believe global flags only propagate downwards tho.

if we want to have it global, we have to declare the options on the same or higher level than the commands themselves

Yes, we should check those cases. If 2+ subcommands are using the exact same options (may be the case for TransactionOptions for instance), yes we do want to declare the option one level higher to ensure all subcommands has access to it.

@lambda-0x
Copy link
Contributor Author

lambda-0x commented Apr 24, 2024

does this change anything on how we can use the flags ? i believe global flags only propagate downwards tho.

no i think it just increases amount of places where we can use the flags (i.e. childs as you mentioned)

if we want to have it global, we have to declare the options on the same or higher level than the commands themselves

generally people will want to provide this transaction related arguments at or near the end so having it only extend to childs is fine. if we hoist those now they will be shown even for commands that dont make sense. like having TransactionOptions for apply plan isn't useful.

for example:

i dont think anyone would want to do

sozo auth --max-fee-raw 1000000000 grant writer Game,0x123

@kariy
Copy link
Member

kariy commented Apr 24, 2024

generally people will want to provide this transaction related arguments at or near the end so having it only extend to childs is fine. if we hoist those now they will be shown even for commands that dont make sense. like having TransactionOptions for apply plan isn't useful.

for example:

i dont think anyone would want to do

sozo auth --max-fee-raw 1000000000 grant writer Game,0x123

ah, i just realized AuthKind is a command, thought it was an arg. So assumed that nothing changed.

make sense then

@lambda-0x lambda-0x changed the title feat: enable global flag for TransactionOptions feat: enable global flag for all commands/options Apr 24, 2024
@glihm glihm merged commit a573198 into main Apr 24, 2024
12 checks passed
@glihm glihm deleted the global-txn-options branch April 24, 2024 20:13
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.

3 participants