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: cmd package #144

Merged
merged 12 commits into from
Jul 10, 2020
Merged

refactor: cmd package #144

merged 12 commits into from
Jul 10, 2020

Conversation

nikoksr
Copy link
Collaborator

@nikoksr nikoksr commented Jul 10, 2020

Summary

Simply refactor the cmd package.

Proposed Changes

  • Move most of the arg validation to cobra
  • Optimize some of the flag handlers

nikoksr added 10 commits July 9, 2020 12:04
DisableColors used to take a boolean which defined if colors should be
disabled. It was evaluated internally and colors were disabled on a
positve value (true). Now DisableColors just disables colors and the
evaluation, when colors should be disabled is left open to the calle.
Remove New* functions of custom errors. Use the bare errors instead.
Less verbose documentation and cleaner looking code.
URL returns the full url object of the attached repository.
…/gookit/color-1.2.6' into change-project-architecture
Split up big handler function in smaller sub-handlers, each dedicated to
a command flag. Evaluate the flags in a switch statement and execute
them accordingly.
Small helper functions for the flag handlers.
@nikoksr nikoksr merged commit 6cd70da into master Jul 10, 2020
@nikoksr nikoksr deleted the refactor-cmd-package branch July 10, 2020 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant