updated .gitignor

This commit is contained in:
Tristan Ancelet
2026-08-10 13:00:23 -05:00
parent 29327a3e83
commit 405303e4f8
3 changed files with 11 additions and 69 deletions
+11 -14
View File
@@ -1,14 +1,11 @@
# Crystal build artifacts *
/.build/ !CLAUDE.md
/bin/ !src/
!src/**
# Compiled test binary (crystal build test.cr) !shard.yml
test !README.md
!design.adoc
# Shards cache !docs/
/.shards/ !docs/**
/lib/ !Makefile
!LICENSE
# Editor
tags
.DS_Store
-52
View File
@@ -1,52 +0,0 @@
require "./src/cligen"
#CliGen.override_help_template "test.ecr"
module MyModule
class MyData
extend CliGen::Coercable
extend CliGen::Parseable
DELIMITER = '.'
getter val : Int32
def initialize(@val : Int32)
end
def self.parse_args(args : Array(CliGen::Arg)) : MyData
arg = args.first
arg.processed
new(val: arg.value.to_i32)
end
def self.coerce(arg : String) : MyData
if arg =~ /^[[:digit:]]+$/
new(val: arg.to_i32)
else
raise "ERROR parsing #{arg}"
end
end
end
@[CliGen::CommandInfo(description: "Test")]
class MyClass < CliGen::Command
argument(myvar3 : Array(MyModule::MyData), description: "Custom data")
argument(myvar2 : MyModule::MyData, description: "Custom data", validation: ->(v : MyModule::MyData) : Bool { v.val != 2 })
argument(myvar : Int32 = 123, description: "Set myvar", validation: ->(v : Int32) : Bool { (0..123).includes?(v) }, on_match: ->() : Nil { puts "Was called" })
subcommand dothing : Nil, description: "DOING ALL THE THINGS" do
puts "DO THE THING : myvar : #{@myvar}"
puts @myvar2.val
@myvar3.each do |var|
puts var.val
end
end
end
CliGen::App.process
end
-3
View File
@@ -1,3 +0,0 @@
Command: <%= @name %>
This was a test