Comments (3)
I expect that will be OK.
If the application had set up a SynchronizationContext before rootCommand.InvokeAsync, then that could cause problems with ASP.NET Core; but your code doesn't do that.
You could also get a CancellationToken from System.CommandLine and gracefully shut down the host when cancellation is requested. This seems to have a risk of deadlock on .NET Framework (#832), but modern versions of ASP.NET Core aren't supported on .NET Framework anyway.
from command-line-api.
It will add a bit to your callstack. That isn't a problem, but you'll see it.
You could also set a flag you evaluate after parsing. We do that in some of the tests. While I do not think what you are doing is likely to have problems, it would pull the significant code you have in the handler in a place in your code you could might be able to manage it better, from a human standpoint, and possibly test it better,
from command-line-api.
@KalleOlaviNiemitalo @KathleenDollard Thanks for the feedback and observations!
from command-line-api.
Related Issues (20)
- List<CliToken> tokenList should be renamed to List<CliToken> tokens
- Redesign to remove `PipelineResult.NotRun`
- [Question] Nuget version releases HOT 3
- Issues with dotnet-suggest HOT 4
- How to use System.CommandLine in WinForm? HOT 3
- Embedded quotes / json data as argument issue with examples HOT 7
- `whatif` HOT 1
- Consider hyphen support for files in Powderhouse
- Consider commonality between Validation and Completions (possibly expanded Help and Diagramming) HOT 3
- How to get `Command` when setting up host.
- Consider fixing capitalization on Powderhouse
- Clarify what data should be static, on pipeline or on subsystem HOT 3
- Updated Subsystem data storage
- Consider a Display String concept
- # Powderhouse Validation
- Value Sources (Subsystem/Pipeline layer) HOT 1
- Class and Property Attributes HOT 1
- [Feature Request] Allow response files to resolve the environment variables. HOT 4
- Wrong argument applied
- Type or namespace name 'CliCommand' not found. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from command-line-api.