Skip to content

fix: fix bugs with repeated option#65

Merged
Jumpaku merged 1 commit intomainfrom
fix/bugs
Nov 7, 2025
Merged

fix: fix bugs with repeated option#65
Jumpaku merged 1 commit intomainfrom
fix/bugs

Conversation

@Jumpaku
Copy link
Owner

@Jumpaku Jumpaku commented Nov 7, 2025

This pull request fixes the handling of the repeatable option in the CLI feature tests for docs, C++, Dart 3, PHP and C#. The most significant changes include updating version numbers across documentation files, changing the type of the repeatable option from a string to a list/vector of integers, and ensuring both long and short option names are supported for repeatable options in tests.

Documentation and Schema Updates

  • Updated all references to the CLI schema and documentation from version 2.0.0 to 2.0.1 in cyamli-cli.schema.json, cyamli-cli.schema.yaml, cyamli-docs.html, cyamli-docs.md, and cyamli-docs.text. [1] [2] [3] [4] [5]

CLI Fix docs and bugs related to repeated option

  • Changed the type of Opt_RepeatableOption from string to std::vector<std::int64_t> in C++ and from string to List<long> in C#, updating its initialization and usage in all relevant test cases. [1] [2] [3] [4] [5]
  • Modified the CLI parsing logic to support both the long (-repeatable-option) and short (-r) forms for the repeatable option, and to correctly accumulate multiple values as a vector/list.
  • Updated test cases to use the short form -r=0 for the repeatable option where appropriate, ensuring consistency with the new parsing logic. [1] [2] [3] [4] [5] [6]
  • Adjusted CLI documentation output in tests to reflect the repeatable integer option, showing both long and short forms and the correct type.

These changes modernize the CLI schema and improve the robustness and clarity of repeatable option handling in feature tests.

@Jumpaku Jumpaku requested a review from Copilot November 7, 2025 19:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR bumps the version from v2.0.0 to v2.0.1 and fixes several bugs related to repeatable options. The key changes include:

  • Version updated from v2.0.0 to v2.0.1 across schema files and documentation
  • Changed -repeatable-option type from string to integer with the repeated: true flag and added short option -r
  • Fixed code generation templates for multiple languages (PHP, Dart, C#, C++) to properly handle repeated options by accessing array elements correctly
  • Updated documentation templates to conditionally show default values and add repetition indicators for repeated options
  • Regenerated all test files and examples with the corrected behavior

Reviewed Changes

Copilot reviewed 58 out of 76 changed files in this pull request and generated no comments.

Show a summary per file
File Description
v2/schema/cyamli-cli.schema.yaml Updated schema $id URL from v2.0.0 to v2.0.1
v2/schema/cyamli-cli.schema.json Updated schema $id in JSON format
v2/examples/features/cli.cyamli.yaml Changed -repeatable-option to type integer with repeated flag and short option
v2/generate/php/Input.php.tpl Fixed array indexing bug for repeated options (accessing v[0]) and corrected type reference
v2/generate/dart3/cli.gen.dart.tpl Fixed type casting to use correct type instead of hardcoded bool
v2/generate/csharp/cli.gen.cs.tpl Fixed array access for repeated options
v2/generate/cpp/cli.gen.cpp.tpl Fixed to use vector operations instead of single value assignment
v2/docs/*.tpl Updated to conditionally hide defaults for repeated options and show repetition markers
v2/cmd/cyamli/* Version bump and regenerated documentation strings
test/** Regenerated test files with corrected types and values
docs/* Version bump in documentation files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Jumpaku Jumpaku merged commit 0986e33 into main Nov 7, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants