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 CLI organisation, and improve termination #570

Merged
merged 7 commits into from
Aug 22, 2022
Merged

Conversation

XAMPPRocky
Copy link
Collaborator

As part of what we discussed in #555 we want to improve the CLI of run to be better, as part of that to make code for the commands more easily maintainable, I've first gone ahead and done a small refactor that moves each command into its own file and implementing them as their own types with a method to run them. This improves locality by a lot as now everything related to one command exists entirely in that one file.

The only actual changes in this PR are the following.

  • In src/main.rs we now catch the result ourselves and ensure to emit it as a tracing::error, using the Display formatting before exiting with a non-zero error code. Previously it would use the Debug formatting and output to stdout.
  • We now expose a Cli type from the library that can be used to drive the application, as opposed to exposing run and manage as free functions.

Copy link
Contributor

@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🧹

@XAMPPRocky XAMPPRocky force-pushed the cli-refactor branch 3 times, most recently from 2d6d7cb to 5977458 Compare August 16, 2022 09:34
@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 37168eb6-6ba6-441b-a219-7246e2dfb0c0

To build this version:

git fetch git@github.com:googleforgames/quilkin.git pull/570/head:pr_570 && git checkout pr_570
cargo build

@XAMPPRocky XAMPPRocky merged commit b9cd1f6 into main Aug 22, 2022
@markmandel markmandel deleted the cli-refactor branch August 27, 2022 05:53
@markmandel markmandel added the kind/cleanup Refactoring code, fixing up documentation, etc label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Refactoring code, fixing up documentation, etc size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants