natemcmaster / CommandLineUtils

Command line parsing and utilities for .NET

Home Page:https://natemcmaster.github.io/CommandLineUtils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Setting multiple commands with builder API

GuerrillaCoder opened this issue · comments

Is it possible to do something like this:

app.Command("command1", setCmd =>
{
    //...
    
    setCmd.OnExecute(() =>
    {
        //..
    });
});

app.Command("command2", setCmd =>
{
    //...
    
    setCmd.OnExecute(() =>
    {
        //..
    });
});

When I try that it only recognizes the first command.

I want to have multiple top level commands and then multiple nested commands but it seems to only allow one top level command and ignores subsequent ones.

I don't know why but it started working.