Skip to content

The Description field of VersionOptionFromMemberAttribute is unused. #480

@siegfriedpammer

Description

@siegfriedpammer

Describe the bug
The Description field of VersionOptionFromMemberAttribute is unused.

To Reproduce
Steps to reproduce the behavior:

  1. Using this version of the library: '3.1.0' and '4.0.0-beta.74'
  2. Use
using McMaster.Extensions.CommandLineUtils;
using System;

namespace HelpTextBug
{
    [Command(Name = "xyz", Description = "Description")]
    [HelpOption("-h|--help")]
    [VersionOptionFromMember("-v|--version", Description = "This is never shown.",
    MemberName = nameof(VersionText))]

    class Program
    {
        public static int Main(string[] args) => CommandLineApplication.Execute<Program>(args);

        public string VersionText => "This is the version text.";

        private int OnExecute(CommandLineApplication app) => 0;
    }
}
  1. With these arguments '--help'

Expected behavior

Options:
-  -v|--version  Show version information.
+  -v|--version  This is never shown.
  -h|--help     Show help information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueThis seems like a good issue if you're a new contributor.help wantedWe would be willing to take a well-written PR to help fix this.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions