Skip to content

Mix verbs with options #442

Open
Open
@UmairB

Description

@UmairB

Is it possible to do something like the following?

myapp --interactive
myapp --service
myapp import --file C:\test.xml --model ModelOne

So I want the option of using the import verb, if one is supplied, --file and --model are required. If not, then check if --interactive or --service were supplied.

I tried something like the following

class Options
{
    [Option('i'...
    public bool Interactive { get; set; }
    
    [Option('s'...
    public bool Service { get; set; }

    public ImportOptions Import { get; set; }

    [Verb("import"...
    public class ImportOptions
    {
          ...
    }
}

I am using 2.1.1-beta on .net standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions