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

Feature: Add to have a configuration file PropertySource as command options #21

Open
tchiotludo opened this issue Jan 1, 2020 · 1 comment
Assignees
Labels
type: enhancement New feature or request

Comments

@tchiotludo
Copy link

It will be very nice to have the possibility to declare a new option on picocli micronaut that will be used a new PropertySource (maybe with Custom Type Converters), like that :

public class MyCliAppCommand implements Runnable { 
    @Option(names = {"-c", "--config"}, description = "Path to configuration file") 
    PropertySourceFile config;
}

The file will be added as a PropertySource and will override the default one.
I think it's a standard behavior of a some cli app to have a configuration file option in order to avoid the lot of --optA A --optB B --optC C

As I see, for now, there is no workaround to allow this kind of options (or need to parse the args like on #20).
And as i see the PropertySource can't be added after the init of ApplicationContext (no way to add some configuration during runtime).

@graemerocher graemerocher added the type: enhancement New feature or request label Apr 26, 2020
@edward3h
Copy link

I have a similar request - it would be nice to override or add an environment with an option. Again there's a problem with the order of initializing the context!

e.g. I could run

mycmd --environment production ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants