'how to make the CLI tool display commands in help window in C#

I am working on a CLI tool and want to display commands as well as options when using --help.

I have created a class known as CommandLineOptions which has all the options and it is displayed when i do --help

[Option("name", Required = true, HelpText = "name of the person")]
    public string? name { get; set; }

How do i add command so, when i do --help, commands are also displayed



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source