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

Running/parsing parent command alongside with child command #221

Open
hellozyemlya opened this issue Feb 25, 2023 · 3 comments
Open

Running/parsing parent command alongside with child command #221

hellozyemlya opened this issue Feb 25, 2023 · 3 comments
Assignees
Labels
concept Help and further investigation on the proposal is needed.

Comments

@hellozyemlya
Copy link

Hi. Is it possible to parse command lines more like urls /command//subcommand/?

For following commands:

[Command("group")]
public class GroupCommand : ICommand
{
    [CommandParameter(0, Description = "Group ID")]
    public string Group { get; set; }
    
    public async ValueTask ExecuteAsync(IConsole console)
    {
        await console.Output.WriteLineAsync("Group");
    }
}

[Command("group add")]
public class GroupAddCommand : ICommand
{
    [CommandParameter(0, Description = "group value")]
    public string Value { get; set; }
    public async ValueTask ExecuteAsync(IConsole console)
    {
        await console.Output.WriteLineAsync("Group");
    }
}

I want to achieve following behaviour: cli.exe group 123 add 321 e.g. parse all arguments and parameters for GroupCommand , and then parse GroupAddCommand. And of course get all the arguments in GroupAddCommand. Is it possible in current version?

@hellozyemlya hellozyemlya added the concept Help and further investigation on the proposal is needed. label Feb 25, 2023
@adambajguz
Copy link
Owner

adambajguz commented Feb 27, 2023

Hi @hellozyemlya,
This is not possible with the current stable release. The new ASP.NET Core-like version of Typin is still in develpoment (I was focused on other projects and didn't have time to finish Typin 4.0 yet). Typin 4.0 will allow to personalize every aspect of it, including the implementation of the behavior you want.

@hellozyemlya
Copy link
Author

@adambajguz thanks for reply. Is there a branch name of ASP.NET core-like version to check code?

@adambajguz
Copy link
Owner

adambajguz commented Mar 7, 2023

The changes are on develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concept Help and further investigation on the proposal is needed.
Projects
None yet
Development

No branches or pull requests

2 participants