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

Add cache-related CLI options #8

Merged
merged 4 commits into from
Jul 17, 2024
Merged

Conversation

matyama
Copy link
Owner

@matyama matyama commented Jul 17, 2024

This PR implements the following CLI changes:

  • Adds value_hints to both --config-file and --cache-dir CLI options
  • Fixes ignored --cache-dir option
  • Adds new --no-cache CLI flag which disables local caching
  • Adds new --offline mode under which the app won't issue any API requests and will only rely on the local cache

This commit adds `value_hint`s to both `--config-file` and `--cache-dir`
CLI options.

This should provide shells such as zsh and fish with a hint how to
complete these arguments.
Before this change the value of `--cache-dir` CLI option was ignored.
Now it overrides the value loaded from the TOML config, as it should.
This commit add new `--no-cache` CLI flag which, if set, disables
caching for current command invocation.

This flag takes priority over and overrides the `--cache-dir` option.
This commit adds new CLI flag `--offline`. Under the _offline_ mode, the
API client won't issue any HTTP requests and will only rely on the local
cache.

In case the cache does not contain requested data, an error is reported.

Note that the CLI option cannot be combined with `--no-cache` (for
obvious reasons) and that disabling the cache via `--cache-dir` will in
turn disable the offline mode.
@matyama matyama merged commit 6f53b3c into main Jul 17, 2024
6 checks passed
@matyama matyama deleted the add-cache-related-cli-options branch July 17, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant