Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: major overhaul of API #9

Merged
merged 1 commit into from
Jun 3, 2024
Merged

refactor: major overhaul of API #9

merged 1 commit into from
Jun 3, 2024

Conversation

arikkfir
Copy link
Owner

@arikkfir arikkfir commented Jun 3, 2024

This refactor overhauls the API in preparation for v1.0.0.

Following major changes have been applied:

  • Users now implement the Executor interface, instead of the Command
    interface. The Command object is now the container for a single
    command, created via the "New" factory.
  • Configuration schema is read from the given Executor instance's type.
    Any field in that struct can be a potential flag or args target. The
    API now allows customization of such flags via struct field tags (to
    be documented). Configuration can be nested in multi-level structs for
    grouping and reuse.
  • Commands can also be created via "MustNew" which panics if command
    creation fails.
  • Better command hierarchy with clear definition of which flags are
    inherited from parent commands to child commands.
  • Improved help & usage screens
  • Better code & file structure

@arikkfir arikkfir self-assigned this Jun 3, 2024
@arikkfir arikkfir added refactor Structural changes without functional changes feature New features and functionality test Changes or additions to testing code labels Jun 3, 2024
@arikkfir arikkfir force-pushed the arikkfir/refactor branch 3 times, most recently from de34d76 to 1d53c7c Compare June 3, 2024 22:14
This refactor overhauls the API in preparation for v1.0.0.

Following major changes have been applied:
- Users now implement the Executor interface, instead of the Command
  interface. The Command object is now the container for a single
  command, created via the "New" factory.
- Configuration schema is read from the given Executor instance's type.
  Any field in that struct can be a potential flag or args target. The
  API now allows customization of such flags via struct field tags (to
  be documented). Configuration can be nested in multi-level structs for
  grouping and reuse.
- Commands can also be created via "MustNew" which panics if command
  creation fails.
- Better command hierarchy with clear definition of which flags are
  inherited from parent commands to child commands.
- Improved help & usage screens
- Better code & file structure
- Add golang CI linting
@arikkfir arikkfir merged commit 270d291 into main Jun 3, 2024
4 checks passed
@arikkfir arikkfir deleted the arikkfir/refactor branch June 3, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New features and functionality refactor Structural changes without functional changes test Changes or additions to testing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant