You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// set the console title.Console.Title="Elskom workload cross-platform installer";// Need to register the code pages provider for code that parses// and later needs ISO-8859-2Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);// Test that it loads_=Encoding.GetEncoding("ISO-8859-2");varapp=newCommandApp();app.Configure(config =>{config.AddCommand<InstallCommand>("install").WithDescription("Installs the Workload.");config.AddCommand<UninstallCommand>("uninstall").WithDescription("Uninstalls the Workload.");config.AddCommand<UpdateCommand>("update").WithDescription("Updates the Workload.");});// This args stuff could probably be simplified.varfinalArgs=newList<string>();varfirstArg=args.FirstOrDefault()?.Trim().ToLowerInvariant()??string.Empty;if(firstArg!="install"&&firstArg!="uninstall"&&firstArg!="update"){finalArgs.Add("install");}if(args.Any()){finalArgs.AddRange(args);}using(NuGetHelper.HttpClient=newHttpClient()){varresult=awaitapp.RunAsync(finalArgs).ConfigureAwait(false);Console.Title="";returnresult;}
The text was updated successfully, but these errors were encountered:
It seems if I made the settings type internal without making the types in my cli program (like InstallCommand) internal as well that the code does not compile, but unclear that if I do that as well if Spectre would recognize those as commands too.
Ok, I did some testing by moving all the real code that the cli program project itself uses into a separate library project (including the command classes and made them all internal, added InternalsVisibleTo on that separate project for the cli project to see the internals), then built and debug went smoothly.
Either both command and settings need to be internal, or command and settings public. Mixing internal and public will not compile, and is nothibg that we will try to support.
I would love to be able to do this on one of my programs:
WorkloadSettings.cs:
InstallCommand.cs:
Program.cs:
The text was updated successfully, but these errors were encountered: