Skip to content

Commit

Permalink
feat(config): adding base command synced with toml file (#8)
Browse files Browse the repository at this point in the history
## Motivation

![image](https://github.com/user-attachments/assets/43c3dd12-f952-4b72-8165-685a616392a5)

CQLsh has as a basis a config file that you can use and we should do the
same to make it easier for testing purposes.

When the application start, it will be checking at
`~/.config/scyllash/config.toml` and if it doesn't exists, the app will
create one as a basis to use cloning the `default_config.toml`:

```toml
[connection]
hostname = "127.0.0.1"
port = 9042
username = "scylla"
password = ""
timeout = 10
```

Clap is an addition to further features which can fit together, like a
profile configuration however this we can discuss in another issue.
  • Loading branch information
danielhe4rt authored Aug 22, 2024
1 parent 78bcebe commit f8fc719
Show file tree
Hide file tree
Showing 8 changed files with 369 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
.idea
178 changes: 178 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ edition = "2021"

[dependencies]
chrono = "0.4.38"
clap = { version = "4.5.16", features = ["derive"] }
color-eyre = "0.6.3"
ratatui = { version = "0.28.0", features = ["all-widgets"] }
scylla = "0.13.2"
serde = { version = "1.0.208", features = ["derive"] }
tokio = { version = "1.39.3", features = ["full"] }
toml = "0.8.19"
uuid = { version = "1.10.0", features = ["v1", "v4"] }
Loading

0 comments on commit f8fc719

Please sign in to comment.