Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dotnet add package McMaster.Extensions.CommandLineUtils
- using McMaster.Extensions.CommandLineUtils;
- using static Bullseye.Targets;
- class Program
- {
- static void Main(string[] args)
- {
- var app = new CommandLineApplication(throwOnUnexpectedArg: false);
- var id = app.Option<string>("--id", "The ID of something to import", CommandOptionType.SingleValue);
- app.OnExecute(() =>
- {
- Target("importSomething", () => System.Console.WriteLine($"id={id.Value()}"));
- RunTargets(app.RemainingArguments);
- });
- app.Execute(args);
- }
- }
- // dotnet run -- --id=123 importSomething
Add Comment
Please, Sign In to add comment