Comments (3)
the current bright idea is to use the IActivityExtensions
class to Parse()
and DisplayHelp()
.
from songhaycore.
the latest bright idea is to pass args
to the constructor of ActivitiesGetter
to get Activity arguments and Activity name; the conventional help system should be part of ProgramArgs
from songhaycore.
This test, ShouldGetActivityFromDefaultName()
, passes, addressing this issue.
Piggy-backed on this issue was coverage of the JsonConfiguration
class for .NET Standard 2.0. Specifically, TraceSourceExtensions.EnsureTraceSource
was added to optionally throw an exception when traceSource
is null.
MSTEST2 Stuff
Note that the IConfigurationBuilderExtensions.WithSettingsJsonFile
extension method looks for a basePath
in the current directory or will turn to Environment.GetCommandLineArgs()
. These conventions are not test friendly as MSTEST populates args
with its own stuff. The workaround is to set our conventional app-settings.json
to copy to the output directory.
One last MSTEST2 thing: since .NET Core does not support declaring trace listeners in configuration, I have to resort to stuff like this:
using (var listener = new TextWriterTraceListener(Console.Out))
{
traceSource.Listeners.Add(listener);
var args = new[]
{
nameof(GetHelloWorldActivity),
"--world-name",
"Saturn"
};
var getter = new MyActivitiesGetter(args);
var activity = getter.GetActivity();
Assert.IsNotNull(activity);
activity.Start(getter.Args);
listener.Flush();
}
Command-Line Help from ProgramArgs
Even though this issue is resolved, I would like to break the rules and tack on command-line help support around the recently added ProgramArgs.HelpSet
property.
from songhaycore.
Related Issues (20)
- change `StreamReaderExtensions.ReadLines` to `break` out of the `while` loop
- add `ByteExtensions` to support ASP.NET file-upload scenarios
- add new members to `IDictionaryExtensions` HOT 1
- consider adding a `Result<T1,T2>` type to provide alternative methods that do not throw exceptions
- review code for βBest practices for comparing strings in .NETβ HOT 1
- remove `DebuggerAttached*` attribute definitions ππ₯
- The name `ConvertDateTimeToUtc` confuses date formats and time zones HOT 1
- add `IPrincipalExtensions`
- add `ILoggerExtensions` and a dependency on `Microsoft.Extensions.Logging`
- add `MenuDisplayItemModelExtensions.GetAllBy` method
- add `IServiceProviderExtensions`
- add `TestScalars`
- update `Orderers` classes
- add `ProgramUtility.GetConsoleIndentation` π¨ β¨
- add `DbDataReaderExtensions` π β¨
- the .NET Hosted Service (`IHostedService`) and the Songhay Activity (`IActivity`)
- the .NET `ILogger` interface and the Songhay Activity `IActivity`
- `IActivityWithTask*` should not inherit from `IActivity` π¨π₯
- the `--activity-name` parameter needs to be added to `ConsoleArgsScalars`
- `GetSettingsFilePath` is not returning a path but file content
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 songhaycore.