gsscoder / commandline

Terse syntax C# command line parser for .NET with F# support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using --help

ajtruckle opened this issue · comments

Out of interest now when I use --help I get the help listed twice:

C:\Program Files (x86)\Meeting Schedule Assistant\OutlookCalIFConsole>outlookcalifconsole --help
OutlookCalIFConsole 2018.4.4.1
Copyright c  2017 - 2018

  -l, --list          Builds a list of available calendars. Eg: -l ".\CalendarList.xml"

  -m, --mode          Type of events to add to the calendar. Modes: mwb. Eg: -m mwb

  -p, --path          Path to the events data file. Eg: -p ".\EventsToAdd.xml"

  -t, --tokencache    Required. The location of the token cache data file. Eg: -t "file.dat"

  -e, --errorlog      Required. The location for the error log. Eg: -e "<path to error folder>"

  -s, --signout       Sign out from Outlook calendar

  --help              Display this help screen.

  --version           Display version information.

OutlookCalIFConsole 2018.4.4.1
Copyright c  2017 - 2018

  -l, --list          Builds a list of available calendars. Eg: -l
                      ".\CalendarList.xml"

  -m, --mode          Type of events to add to the calendar. Modes: mwb. Eg: -m
                      mwb

  -p, --path          Path to the events data file. Eg: -p ".\EventsToAdd.xml"

  -t, --tokencache    Required. The location of the token cache data file. Eg:
                      -t "file.dat"

  -e, --errorlog      Required. The location for the error log. Eg: -e "<path
                      to error folder>"

  -s, --signout       Sign out from Outlook calendar

  --help              Display this help screen.

  --version           Display version information.

Why might this be? If I use --version it is not listed twice.

I am using standard code to build the help:

        static int Main(string[] args)
        {
            var parserResult = CommandLine.Parser.Default.ParseArguments<Options>(args);

            parserResult.WithParsed<Options>(options => OnSuccessfulParse(options));
            parserResult.WithNotParsed<Options>(errs =>
            {
                var helpText = HelpText.AutoBuild(parserResult, h =>
                {
                    return HelpText.DefaultParsingErrorsHandler(parserResult, h);
                }, e =>
                {
                    return e;
                });
                Console.WriteLine(helpText);
                ReturnErrorCode = ErrorCode.CommandLineArguments;
            });

            return (int)ReturnErrorCode;
        }

Also, why doesn't the default help keyword have a short version of h?

commented

Closing as this repo is no longer used or monitored.