KittyCAD / cli

The Zoo command line tool.
MIT License
16 stars 2 forks source link

Fix setting a default host through command line #841

Closed lf94 closed 2 months ago

lf94 commented 2 months ago

When trying to set a default host through the command line, the CLI would report that default is an invalid key. This is because it was not part of the set of ConfigOption's. The problem with just adding it to there, which I did at first just to see something working, is that these options are also meant to be top-level options. I had to redesign the program a little bit to understand the notion of host-level options and top-level options that can also be host-level options.

A test is added to ensure that only one host can ever be set as default.

jessfraz commented 2 months ago

nice lgtm merge when ready and green

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 97.90210% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.74%. Comparing base (78aac10) to head (cdc5ef5). Report is 6 commits behind head on main.

Files Patch % Lines
src/types.rs 0.00% 2 Missing :warning:
src/cmd_config.rs 98.83% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #841 +/- ## ========================================== - Coverage 77.78% 77.74% -0.05% ========================================== Files 36 36 Lines 7738 7769 +31 ========================================== + Hits 6019 6040 +21 - Misses 1719 1729 +10 ``` | [Flag](https://app.codecov.io/gh/KittyCAD/cli/pull/841/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=KittyCAD) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/KittyCAD/cli/pull/841/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=KittyCAD) | `77.74% <97.90%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=KittyCAD#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.