Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Description field of VersionOptionFromMemberAttribute is unused. #480

Closed
siegfriedpammer opened this issue Nov 29, 2021 · 1 comment · Fixed by #490
Closed

The Description field of VersionOptionFromMemberAttribute is unused. #480

siegfriedpammer opened this issue Nov 29, 2021 · 1 comment · Fixed by #490
Labels
bug good first issue This seems like a good issue if you're a new contributor. help wanted We would be willing to take a well-written PR to help fix this.
Milestone

Comments

@siegfriedpammer
Copy link

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.
@natemcmaster natemcmaster added good first issue This seems like a good issue if you're a new contributor. help wanted We would be willing to take a well-written PR to help fix this. labels Dec 4, 2021
@natemcmaster
Copy link
Owner

Seems like something that should be easy to fix. I would accept a pull request to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue This seems like a good issue if you're a new contributor. help wanted We would be willing to take a well-written PR to help fix this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants