adamabdelhamed / PowerArgs

The ultimate .NET Standard command line argument parser
MIT License
569 stars 56 forks source link

ArgHiddenFromUsageAttribute has no effect #105

Closed bitbonk closed 7 years ago

bitbonk commented 7 years ago

In the following command line definition the ArgHiddenFromUsageAttribute has no effect. When I type ( mytool.exe -? the -G paramter is still documented.

[ArgExceptionBehavior(ArgExceptionPolicy.StandardExceptionHandling)]
[ArgProductName(Statics.ProductDescription)]
[ArgProductVersion(Statics.ProductVersion)]
[ArgCopyright(Statics.ProductCopyright)]
public class CommandLine
{
    [HelpHook]
    [ArgShortcut("-?")]
    [ArgDescription("Shows this help.")]
    public bool Help { get; set; }

    [ArgActionMethod]
    [ArgDescription("desc1")]
    public void Nuget(NugetArgs args)
    {
    }

    [ArgActionMethod]
    [ArgDescription("desc2")]
    public void Files(FilesArgs args)
    {
    }
}

public class NugetArgs
{
    [ArgDescription("desc3")]
    [ArgPosition(1)]
    public string Path { get; set; }
}

public class FilesArgs
{
    [ArgDescription("desc4")]
    public string Path { get; set; }

    [ArgDescription("desc5")]
    [ArgDefaultValue(false)]
    [ArgHiddenFromUsage]
    public bool Generate { get; set; }
}

This what the help outputs. The -G parameter should be hidden.

Usage - VacVerify -options

GlobalOption Description Help (-?) Shows this help.

Actions

Nuget [] - desc1

Option Description Path (-P) desc3

Files -options - desc2

Option Description Path (-P) desc4 Generate (-G) desc5 [Default='False']