Skip to content

Value argument index not respected when sub classing from base class#336

@Bounder

Description

@Bounder

I found an issue where the order/index of the value options is not respected. It happens when i'm using a base class, because of some shared logic between different verbs, and when defining a new value option on a derived class. The value option on the derived class will always be parsed first, no matter the index option on the ValueAttribute. Below a code example of what I mean:

`

public abstract class BaseCommand{[Value(0, MetaName = "Arguement1" Required = true)] public virtual string Argument1{get; set} } [Verb("Command", HelpText = "Issue a command using command line")] public class CommandOption : BaseCommand{[Value(1, MetaName = "Arguement2", Required = true)] public int Argument2{get; set} } 

`

When using the above example the first argument after "command" will always be set to argument2 and the second argument will be set in argument1. I'm not sure if the index parameter of the ValueAttribute should solve this, however changing its value does nothing when using the above construct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions