From 9b3d823bc7ba7ae6e168c6b2fd8c07ffac760f01 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Wed, 12 Aug 2026 12:43:44 -0500 Subject: [PATCH] Comitting for testing --- src/cligen/command/argument.cr | 4 ++-- src/cligen/command/selection.cr | 2 +- src/cligen/flag.cr | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cligen/command/argument.cr b/src/cligen/command/argument.cr index 43e1d88..79fd458 100644 --- a/src/cligen/command/argument.cr +++ b/src/cligen/command/argument.cr @@ -1,11 +1,11 @@ module CliGen class Command - macro argument(variable, description, long = nil, short = nil, validation = nil, on_match = nil, def_setter = false, def_getter = false, options = nil, delimiter = nil) + macro argument(variable, description, long = nil, short = nil, validation = nil, on_match = nil, def_setter = false, def_getter = false, options = nil, delimiter = ",") {% raise "ERROR : CliGen::Command.argument : def_setter must be a Bool" unless def_setter.is_a? BoolLiteral %} {% raise "ERROR : CliGen::Command.argument : First argument (#{variable}) must be a TypeDeclaration (ex: ' : [= val]')" unless variable.is_a? TypeDeclaration %} {% name = variable.var %} {% type = variable.type %} - {% delimiter = "," unless delimiter.is_a? StringLiteral %} + {% raise "ERROR : CliGen::Command.argument(#{name}) : Provided delimiter must be a string" unless delimiter.is_a? StringLiteral %} {% if short %} {% raise "ERROR : CliGen::Command.argument(#{name}) : Provided short must be a string" unless short.is_a? StringLiteral %} {% end %} diff --git a/src/cligen/command/selection.cr b/src/cligen/command/selection.cr index e2e2c5a..30cc1eb 100644 --- a/src/cligen/command/selection.cr +++ b/src/cligen/command/selection.cr @@ -14,7 +14,7 @@ module CliGen {% options = options.resolve if options.is_a? Path %} {% raise "ERROR : CliGen::Command.selection : Provided options must be an ArrayLiteral" unless options.is_a? ArrayLiteral %} - @[CliGen::Argument(short: {{short}}, long: {{long}}, description: {{description}}, validation: {{validation}}, on_match: {{on_match}}, options: {{options}})] + @[CliGen::Argument(short: {{short}}, long: {{long}}, description: {{description}}, validation: {{validation}}, on_match: {{on_match}}, options: {{options}}, delimiter: "-")] @{{variable}} end end diff --git a/src/cligen/flag.cr b/src/cligen/flag.cr index d51a6b0..167e361 100644 --- a/src/cligen/flag.cr +++ b/src/cligen/flag.cr @@ -55,7 +55,7 @@ module CliGen @validate : (T -> Bool)? = nil, @on_match : Proc(Nil)? = nil ) - super(var, short, long, env_var, description) + super(var, short, long, env_var, description, delimiter) end def requires_arg? : Bool