DEV Community

Discussion on: How I want my command inputs, but nobody agrees

Collapse
 
miffpengi profile image
Miff

I figure this is exactly the kind of thing C#'s attributes are for.

[Command("echo", MinArg = 1)]
public class EchoCommand : ICommand {
    public void HandleCommand(CommandArgs args){
        Console.WriteLine(string.Join(args));
    }
}
Collapse
 
legolord208 profile image
jD91mZM2

And that doesn't require too much setting up? Cool!