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

Add --help-all CLI #99

Closed

Conversation

davidbrochart
Copy link
Contributor

@davidbrochart davidbrochart commented Jan 10, 2024

Closes #71

@agronholm what do you think about doing something like that, where the configuration is printed as a side effect of running the application? I guess there is no way to "inspect" the application structure and gather all components' configuration without actually creating the resources, right?
This will show something like:

$ my_app --help-all
Container0 (components: 'dict[str, dict[str, Any] | None] | None' = None) -> 'None'
Container0.container1 (components: 'dict[str, dict[str, Any] | None] | None' = None) -> 'None'
Container0.container2 (components: 'dict[str, dict[str, Any] | None] | None' = None) -> 'None'
Container0.container1.dummy (dummyval1=None, dummyval2=None)
Container0.container2.dummy (dummyval1=None, dummyval2=None)

@davidbrochart davidbrochart marked this pull request as draft January 10, 2024 10:55
@coveralls
Copy link

coveralls commented Jan 10, 2024

Coverage Status

coverage: 97.346%. first build
when pulling ee5ef40 on davidbrochart:help-all
into c879016 on asphalt-framework:master.

@davidbrochart davidbrochart force-pushed the help-all branch 2 times, most recently from ca89a1a to 02d89f5 Compare January 10, 2024 17:10
@agronholm
Copy link
Member

I'm not sure about this. I had been thinking of a different configuration system that would allow both documenting and validating the configuration. Switching to that would require refactoring this option too, and I think it should be renamed regardless. One other thing: I don't like the hackish implementation either. Perhaps this should be deferred until there's a better config system?

@davidbrochart
Copy link
Contributor Author

Sure, no problem. I'm thinking I could also have a component that would be added to the CLIApplicationComponent and that would inspect the child components to achieve the same behavior as in this PR. At least it would be external to Asphalt core.

@davidbrochart davidbrochart deleted the help-all branch January 12, 2024 08:19
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.

Gather all component configurations
3 participants