Skip to content

argument definition with parser combinator #433

@kazupon

Description

@kazupon

Clear and concise description of the problem

The definition of gunshi's args is declarative configuration-based, which offers the advantage of being human-readable.
However, when defining custom-based args, you must parse them yourself using type: ‘custom’, and integration with validation libraries like zod can be a bit cumbersome.

Furthermore, since type generation is a declarative configuration, providing type safety for custom validation is extremely difficult.

We are considering introducing a function-based parser combinator to solve these issues while preserving gunshi's advantage of declarative configuration.

Suggested solution

We plan to provide the parser combinator on the args-token side. This will maintain compatibility with args defined via declarative configuration while allowing users to utilize it freely.

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guide.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIncludes new features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions