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

How is ArgumentRequiresOtherArgumentsCertification supposed to work? #48

Closed
mhsimkin opened this issue Aug 9, 2017 · 3 comments
Closed

Comments

@mhsimkin
Copy link

mhsimkin commented Aug 9, 2017

I have defined my arguments as:

[DistinctGroupsCertification("s", "h,p")]
    [ArgumentRequiresOtherArgumentsCertification("h", "p,c,i,o")]
    internal class CommandLineArguments
    {
         ValueArgument(typeof(string), 's', "serverName", Description = "The friendly name given to the rabbit server connection.")]
        public string ServerName { get; set; }

        [ValueArgument(typeof(string), 'h', "hostName", Description = "The fully qualified host name of the rabbit server.")]
        public string ServerHostName { get; set; }

        [ValueArgument(typeof(int), 'p', "port", Description = "The port that should be used to connect to the rabbit server.", DefaultValue = 5672)]
        public int Port { get; set; }

        [RegexValueArgument('c', "credentials", CredentialsRegEx,
            Description =
                "The username and password that needs to be used to connect to the rabbit server.  This needs to be in the format username|password")]
        public string Credentials { get; set; }

        [ValueArgument(typeof(string), 'v', "virtualHost", Description = "The virtual host on the rabbit server that contains the scribe exchanges.", DefaultValue = "v.pds.ren.scribe")]
        public string ScribeVirtualHost { get; set; }

        [ValueArgument(typeof(string), 'i', "input", Description = "The scribe input exchange.", DefaultValue = "e.pds.tools.scribe.input")]
        public string ScribeInputExchange { get; set; }

        [ValueArgument(typeof(string), 'o', "output", Description = "The scribe output exchange.", DefaultValue = "e.pds.tools.scribe.output")]
        public string ScribeOutputExchange { get; set; }
}

When I run the application and pass the following on the command line:

-h dwerecrq01.hq.bn-corp.com -c renscribeui@Lithium3

I'm getting a CommandLineException thrown that contains this message:

None of these arguments: h can be used together with any of these: p,c,i,o.

I expected that the parse should of passed as I had default values for p, i, and o.

I'm confused as to why I'm getting a message informing me that I can't use p,c,i,o with h.

Thanks

-marc

@j-maly
Copy link
Owner

j-maly commented Aug 10, 2017 via email

@mhsimkin
Copy link
Author

I'm using 3.0.13.

Thanks

-marc

@j-maly j-maly closed this as completed in e891473 Aug 12, 2017
@j-maly
Copy link
Owner

j-maly commented Aug 12, 2017

Should be fixed in 3.0.14, thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants