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

PersistentFlags support #692

Closed
nkprince007 opened this issue Dec 11, 2017 · 6 comments
Closed

PersistentFlags support #692

nkprince007 opened this issue Dec 11, 2017 · 6 comments
Labels
kind/feature describes a code enhancement / feature request

Comments

@nkprince007
Copy link

Something similar to cobra's PersistentFlag would be a nice addition to save configuration to files.

@meatballhat meatballhat self-assigned this Feb 25, 2018
@asahasrabuddhe asahasrabuddhe self-assigned this Aug 5, 2019
@asahasrabuddhe asahasrabuddhe added the kind/feature describes a code enhancement / feature request label Aug 5, 2019
@asahasrabuddhe
Copy link
Member

@urfave/cli

I think we already can achieve the PersistentFlag functionality through the global lookup functions in the cli context. Does any of you have any other use case in mind or can we close this?

@coilysiren
Copy link
Member

I don't quite grasp the use case, so I'm fine closing this until someone explicitly requests it again.

@AudriusButkevicius
Copy link
Contributor

I guess this is saving a flag that was set in the previous invocation of the cli

@coilysiren coilysiren added the status/claimed someone has claimed this issue label Aug 29, 2019
@coilysiren
Copy link
Member

coilysiren commented Sep 10, 2019

I guess this is saving a flag that was set in the previous invocation of the cli

I believe this is what they're asking for 👍

This seems like a nice feature, but given the age of this issue i'd like to close it until someone requests it again.

@coilysiren coilysiren added status: user feedback required and removed status/claimed someone has claimed this issue labels Sep 10, 2019
@AudriusButkevicius
Copy link
Contributor

I don't think this should be a problem of this library. Users can implement their own persistence.

@chirino
Copy link

chirino commented Nov 20, 2023

That's not what persistent flags do. A persistent flag is a flag defined in a parent command, that can be use in any of the sub commands without having to repeat the flag in the sub command. These a really useful for common flags like --verbose that all sub commands will implement.

See: https://stackoverflow.com/questions/63495992/what-is-the-difference-between-go-cobra-persistentflags-and-flags for other explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature describes a code enhancement / feature request
Projects
None yet
Development

No branches or pull requests

6 participants