Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Command(Name = "istrada", ThrowOnUnexpectedArgument = false, OptionsComparison = System.StringComparison.InvariantCultureIgnoreCase )]
- [VersionOptionFromMember("--version", MemberName = nameof(GetVersion))]
- [Subcommand(
- typeof(LoginCmd),
- typeof(ListTicketCmd))]
- class iStradaCmd : iStradaCmdBase
- {
- public iStradaCmd(ILogger<iStradaCmd> logger)
- {
- _logger = logger;
- }
- protected override Task<int> OnExecute(CommandLineApplication app)
- {
- // this shows help even if the --help option isn't specified
- app.ShowHelp();
- return Task.FromResult(1);
- }
- private static string GetVersion()
- => typeof(iStradaCmd).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement