Skip to content

refactor: major overhaul of API#9

Merged
arikkfir merged 1 commit intomainfrom
arikkfir/refactor
Jun 3, 2024
Merged

refactor: major overhaul of API#9
arikkfir merged 1 commit intomainfrom
arikkfir/refactor

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 force-pushed the arikkfir/refactor branch from 1d53c7c to 88e5df1 Compare June 3, 2024 22:15
@arikkfir arikkfir merged commit 270d291 into main Jun 3, 2024
@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

Comments