mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-12-15 05:15:40 +00:00
Implements support for --no- prefix negation on boolean and flag DU fields when marked with [<ArgumentNegateWithPrefix>]. This allows both --flag and --no-flag forms to be accepted, with --no- variants negating the value. Changes: - Extend ArgParserGenerator to generate --no- prefix handling - Add conflict detection for overlapping --no- prefixed arguments - Update help text to display both forms (e.g., --verbose / --no-verbose) - Add test examples in ArgParserNegationTests.fs demonstrating: - Boolean field negation - Flag DU negation - Multiple ArgumentLongForm with negation - Combined features (defaults, help text) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
982 B
Forth
49 lines
982 B
Forth
namespace ConsumePlugin
|
|
|
|
open WoofWare.Myriad.Plugins
|
|
|
|
// Test types for ArgumentNegateWithPrefix functionality
|
|
|
|
type TestDryRunMode =
|
|
| [<ArgumentFlag false>] Wet
|
|
| [<ArgumentFlag true>] Dry
|
|
|
|
[<ArgParser true>]
|
|
type BoolNegation =
|
|
{
|
|
[<ArgumentNegateWithPrefix>]
|
|
EnableFeature : bool
|
|
}
|
|
|
|
[<ArgParser true>]
|
|
type FlagNegation =
|
|
{
|
|
[<ArgumentNegateWithPrefix>]
|
|
DryRun : TestDryRunMode
|
|
}
|
|
|
|
[<ArgParser true>]
|
|
type MultipleFormsNegation =
|
|
{
|
|
[<ArgumentLongForm "verbose">]
|
|
[<ArgumentLongForm "v">]
|
|
[<ArgumentNegateWithPrefix>]
|
|
VerboseMode : bool
|
|
}
|
|
|
|
[<ArgParser true>]
|
|
type CombinedFeatures =
|
|
{
|
|
[<ArgumentNegateWithPrefix>]
|
|
[<ArgumentDefaultFunction>]
|
|
Verbose : Choice<bool, bool>
|
|
|
|
[<ArgumentNegateWithPrefix>]
|
|
[<ArgumentHelpText "Enable debug mode">]
|
|
Debug : bool
|
|
|
|
NormalBool : bool
|
|
}
|
|
|
|
static member DefaultVerbose () = false
|