nemec / clipr

Command Line Interface ParseR for .Net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help generation via Resources

nemec opened this issue · comments

commented

As the title says, allow help data to be configured by resx files. It doesn't make sense to configure option names themselves from the resx files though.

commented

Currently, this requires resources to be added as a strongly typed resource class. Localized properties are then annotated with a LocalizeAttribute.

[Localize(ResourceType = typeof(Properties.Resources))]
public class LocalizationOptions
{
    [Localize]  // Defaults to LocalizationOptions_TurnOnThePower
    [NamedArgument("turnonthepower", Action = ParseAction.StoreTrue)]
    public bool TurnOnThePower { get; set; }

    [Localize("FileToAdd", typeof(Properties.Resources))]
    [PositionalArgument(0)]
    public string FileToAdd { get; set; }
}

See the README for more.