Commit Graph
13 Commits
Author SHA1 Message Date
tristan 0658dcf215 added convinent to_s method for RelativeOperation 2026-09-08 10:59:59 -05:00
tristan 8fab6912fc Added new macro features. resolve_value + default: key. Added raises to prevent CliGen features from being used outside of a already parsed state, and worked on specs. Will be working on specs later on as well to finish covering regex & redo timeparse & relative_operations 2026-09-07 16:40:02 -05:00
tristan 3fa77f5707 Committing before help rework 2026-09-05 13:19:55 -05:00
tristan 4cce5cc45c Modified a few things:
- Finished implementing relative date parsing and migrated date parsing
  from Flag(T) to it's own dedicated module. Additionally added a
  the ability to do "recursive" relative operations for time searching.
- Additionally made a Struct & Enum for containing relative operations
  around dates.
- Added additional checks in App & CommandNode(T) around checking
  env_vars of flags & checking for duplicate commands
- Added a CommandMeta record to contain the classname of the
  CommandNode(T)
- Seperated out all of the monolitic files (command_node.cr & file.cr).
  Moved the base classes and records into their own files in the dir
  with the same name of their generic counterparts.
- Fixed a number of macro related bugs around Command.argument &
  CliGen.add_global_flag
- My ass hurts from sitting here for hours and doing these changes and
  arguing with claude over what needs to be done. Fun tho.
2026-08-30 22:13:39 -05:00
tristan f2d5c84f2b Made changes:
- Updated .gitignore to include specs
- Re-licensed to MPL-2.0 as I want any modifications to be pushed back
  to the main codebase so that the ecosystem can benefit from developer
  adoption
- Updated LICENSE & shard.yml with new license
- Changed author to personal email as this is not being done for my
  company
2026-08-30 12:52:16 -05:00
tristan fe6112795a Made several modifications:
- Added more complex date/time parsing for Time objects. This includes
  the ability to provide times in epoch format and several others with
  the ability to provide inline timezone offsets without external
  codebase works to convert them. Alongside this I added the ability to
  do relative time (ex: [+-]2 hours|minutes|days) (along with the ability
  to specify timezone if needed)
- Littered the entire codebase with Log object calls to show state of
  everything as the framework does it's stuff. Just needs Log to be
  configured in the codebase consuming my shard
- removed flag collection for use in displaying all flags in the app
  help output. So it will only show global flags & subcommands
- Changed CommandNode#get(short:) & get(long:) & flag?(arg : String)
  methods to check @flags -> @commands.@flags -> CliGen::GLOBAL_FLAGS
  when finding flags. Making it possible to not PRINT out the flag
  output but still be able to set values to a child flag recursively.
2026-08-29 18:51:08 -05:00
tristan a17053f45c Added a specs for flag & arg. As well as changed a few ways I as handling cli args and determining how they're to be passed to each flag 2026-08-16 17:19:10 -05:00
tristanandClaude Sonnet 4.6 8d17de7434 Fix annotation key mismatch: validate -> validation in generate.cr
anno[:validate] was always nil; validation procs were never wired
into Flag(T).new. Correct key is :validation to match the field
name set by the argument macro in command/argument.cr.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATnpoEGXj4RyuMoBLGWcjs
2026-08-10 13:12:12 -05:00
tristanandClaude Sonnet 4.6 ac5711c0df Update .claude/settings.json with project permission allowlist
Allows crystal build/spec/run, shards, git read/write, and ls
without per-call prompts — consistent across machines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATnpoEGXj4RyuMoBLGWcjs
2026-08-10 08:02:58 -05:00
tristanandClaude Sonnet 4.6 519c8dcd44 Remove test binary and test.cr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATnpoEGXj4RyuMoBLGWcjs
2026-08-10 07:59:02 -05:00
tristanandClaude Sonnet 4.6 bc0f56fda9 Add .claude/, .gitignore, and update README
- .claude/settings.json: project-level Claude Code config
- .gitignore: ignores test binary, build artifacts, shards cache, tags
- README.md: expanded with usage example, dev commands, and AI assistance
  disclosure (Claude used for review/bug-checking, not code generation)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATnpoEGXj4RyuMoBLGWcjs
2026-08-10 07:58:15 -05:00
tristanandClaude Sonnet 4.6 6f31a5d27c object_rework: working MVP with runtime CommandNode tree
- BaseCommandNode (abstract) / CommandNode(T) split for heterogeneous tree
- Flag(T) with compile-time type branching, Parsable/Coercable modules
- Arg double-process invariant enforcement
- App.generate macro builds CommandNode tree from Command subclasses
- Command#initialize generated via macro finished, populates ivars from handler
- Reserved -h/--help enforcement in Flag#check!
- MatchType::Help added, SubCommand dispatch fixed
- design.adoc: added Planned Features (markdown docs, bash completion)
- Makefile: tabs, .DEFAULT_GOAL, doc_show target

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-09 22:49:55 -05:00
tristan f5571cde73 Committing before test 2026-08-09 15:20:06 -05:00