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

[WIP] Refactor as importable module #124

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Aug 10, 2022

  1. Break logic out from main into Run()

    This turns the `main` function into strictly CLI parsing
    CalebAlbers committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    051a9c9 View commit details
    Browse the repository at this point in the history
  2. Move legacy extensionFlag parsing to main

    This is potentially controversial, but the idea is that skipping the extension flags is considered a deprecated feature, so moving it to the `main` function instead of the exported `Run` will allow `Run` to move forward without needing to have a backwards-compatible interface.
    CalebAlbers committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    34a0cf1 View commit details
    Browse the repository at this point in the history
  3. Move error printing from Run() to main()

    This way `Run()` doesn't rely on calling `log.Fatal()` and instead returns an error upstream for easier usage in modules
    CalebAlbers committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    bf55c39 View commit details
    Browse the repository at this point in the history
  4. Switch to injecting logger

    Functions that need to log out debug messages now take a `*log.Logger` interface and use that. This should help should you wish to call those functions in a modular way with a different logger, (`hc-log`, `logrus`, etc)
    CalebAlbers committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    3f570ec View commit details
    Browse the repository at this point in the history