gsscoder / commandline

Terse syntax C# command line parser for .NET with F# support
1.63k stars 293 forks source link

VerbAttribute not found in v1.9.71? #486

Closed ravensorb closed 6 years ago

ravensorb commented 6 years ago

I am looking to leverage the VerbAttribute and for some reason when using build 1.9.71, I am getting an error that this attribute doesn't exist (and when I use ilspy to look for it, I cannot find it)

Note: I can find a attribute called VerbOption however that is only valid on properties not classes.

Am I missing something simple?

    [Verb("deletecontent", HelpText = "Deleted old content in the specific Content source")]
    public class DeleteContentOlderThanOptions : BaseOptions
    {
        [Option("olderThan", DefaultValue = null, HelpText = "Delete all content that is older than this date")]
        public DateTime? OlderThan { get; set; }
    }

Errors

1>E:\Project\Options.cs(23,3,23,7): error CS0246: The type or namespace name 'VerbAttribute' could not be found (are you missing a using directive or an assembly reference?)
1>E:\Project\Options.cs(23,3,23,7): error CS0246: The type or namespace name 'Verb' could not be found (are you missing a using directive or an assembly reference?)
1>E:\Project\Options.cs(23,25,23,33): error CS0246: The type or namespace name 'HelpText' could not be found (are you missing a using directive or an assembly reference?)
ConnorWalsh7 commented 6 years ago

I believe in 1.9 you need to build verbs this way https://github.com/gsscoder/commandline/wiki/Verb-Commands

The way you are using it in your code is for 2.0

ravensorb commented 6 years ago

Sigh -- you are 100% correct. I missed that the Very attribute was new in 2.0. Thanks :)