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

sticky option for --disable-logo #231

Merged
1 commit merged into from
Feb 14, 2023
Merged

sticky option for --disable-logo #231

1 commit merged into from
Feb 14, 2023

Conversation

ghost
Copy link

@ghost ghost commented Feb 14, 2023

  1. Move SetOptions / ReadOptions to the very top of klothomain.run
  2. Add a new option, ui.disable-logo
  3. Use this to set a sticky default for the logo, which the existing cfg.disableLogo can override

Examples:

Default

$ cat ~/.klotho/options.yaml
cat: /Users/yuval/.klotho/options.yaml: No such file or directory
$ klotho --version
██╗  ██╗██╗      ██████╗ ████████╗██╗  ██╗ ██████╗
██║ ██╔╝██║     ██╔═══██╗╚══██╔══╝██║  ██║██╔═══██╗
█████╔╝ ██║     ██║   ██║   ██║   ███████║██║   ██║
██╔═██╗ ██║     ██║   ██║   ██║   ██╔══██║██║   ██║
██║  ██╗███████╗╚██████╔╝   ██║   ██║  ██║╚██████╔╝
╚═╝  ╚═╝╚══════╝ ╚═════╝    ╚═╝   ╚═╝  ╚═╝ ╚═════╝

Version: v0.0.0-darwin-arm64
$ klotho --version --disable-logo
Version: v0.0.0-darwin-arm64

Explicitly set ui.disable-logo=false

This is the same behavior as the default, but explicitly set as an option.

$ klotho --set-option ui.disable-logo=false --version
██╗  ██╗██╗      ██████╗ ████████╗██╗  ██╗ ██████╗
██║ ██╔╝██║     ██╔═══██╗╚══██╔══╝██║  ██║██╔═══██╗
█████╔╝ ██║     ██║   ██║   ██║   ███████║██║   ██║
██╔═██╗ ██║     ██║   ██║   ██║   ██╔══██║██║   ██║
██║  ██╗███████╗╚██████╔╝   ██║   ██║  ██║╚██████╔╝
╚═╝  ╚═╝╚══════╝ ╚═════╝    ╚═╝   ╚═╝  ╚═╝ ╚═════╝

Version: v0.0.0-darwin-arm64
$ cat ~/.klotho/options.yaml
ui:
    disable-logo: false
$ klotho --version --disable-logo
Version: v0.0.0-darwin-arm64

Set ui.disable-logo=true

$ klotho --set-option ui.disable-logo=true --version
Version: v0.0.0-darwin-arm64
$ cat ~/.klotho/options.yaml
ui:
    disable-logo: true
$ klotho --version --disable-logo
Version: v0.0.0-darwin-arm64

Standard checks

  • Unit tests: Any special considerations?
  • Docs: Do we need to update any docs, internal or public?
  • Backwards compatibility: Will this break existing apps? If so, what would be the extra work required to keep them working?

1. Move SetOptions / ReadOptions to the very top of klothomain.run
2. Add a new option, ui.disable-logo
3. Use this to set a sticky default for the logo, which the existing
   `cfg.disableLogo` can override

Also a bit of refactoring, so that the string and tri-state *bool can
look the same.
@github-actions
Copy link

Package Line Rate Health
github.com/klothoplatform/klotho/pkg/analytics 2%
github.com/klothoplatform/klotho/pkg/annotation 23%
github.com/klothoplatform/klotho/pkg/cli 4%
github.com/klothoplatform/klotho/pkg/core 21%
github.com/klothoplatform/klotho/pkg/env_var 82%
github.com/klothoplatform/klotho/pkg/exec_unit 54%
github.com/klothoplatform/klotho/pkg/infra/kubernetes 59%
github.com/klothoplatform/klotho/pkg/infra/kubernetes/helm 39%
github.com/klothoplatform/klotho/pkg/input 63%
github.com/klothoplatform/klotho/pkg/lang 38%
github.com/klothoplatform/klotho/pkg/lang/dockerfile 0%
github.com/klothoplatform/klotho/pkg/lang/golang 29%
github.com/klothoplatform/klotho/pkg/lang/javascript 48%
github.com/klothoplatform/klotho/pkg/lang/python 61%
github.com/klothoplatform/klotho/pkg/lang/yaml 0%
github.com/klothoplatform/klotho/pkg/logging 6%
github.com/klothoplatform/klotho/pkg/multierr 95%
github.com/klothoplatform/klotho/pkg/provider/aws 59%
github.com/klothoplatform/klotho/pkg/runtime 78%
github.com/klothoplatform/klotho/pkg/static_unit 33%
github.com/klothoplatform/klotho/pkg/validation 73%
github.com/klothoplatform/klotho/pkg/yaml_util 79%
Summary 41% (3891 / 9513)

@ghost ghost merged commit b929348 into main Feb 14, 2023
@ghost ghost deleted the sticky-logo branch February 14, 2023 22:33
This pull request was closed.
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