WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Command examples #115

@Tyrrrz

Description

@Tyrrrz

Discussed in #114

Originally posted by wayneyaoo December 4, 2021
Can we have concept of "Example" for each command that can be specified by the CLI author and a new section is rendered as "EXAMPLE".

I was imaging something like

[Command("verb")]
public class MyCommand : ICommand
{
    // options and parameters go here as property

    [Example]
    public (static) Example[] Examples = new [] 
        { new Example("verb --option value"), new Example("verb --anotherPositionalOption") };
}

and the examples could be rendered to another section like "EXAMPLE" when ./myapp verb -h is called.

I'm happy to contribute if this looks good. Or we can discuss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions