Skip to content

Commit

Permalink
Merge pull request #2 from cotramarko/fix/unify-naming
Browse files Browse the repository at this point in the history
Unify naming of tool to `snapvault` and add more extensive description
  • Loading branch information
cotramarko authored Jun 22, 2024
2 parents 06d1eeb + 538f5e2 commit 00f8001
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ builds:
- linux
- windows
- darwin
binary: snapvault

archives:
- format: tar.gz
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A PostgreSQL backup tool that effortlessly captures and restores precise snapsho

## Usage
```shell
$ snapvault save <snapshot_name>
$ snapvault save <snapshot_name>
```
```shell
$ snapvault restore <snapshot_name>
Expand Down
23 changes: 15 additions & 8 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ import (

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "sv",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Use: "snapvault",
Short: "A PostgreSQL backup tool for capturing and restoring snapshots of your database.",
Long: `A PostgreSQL backup tool for capturing and restoring snapshots of your database.
THe snapvault CLI tool is intended to be used during local development as an easy way to capture
and restore snapshots of the database, making it possible to quickly restore the database to a
previous state. It supports basic commands such as "save", "restore", "list" and "delete".
The database URL can be specified in multiple ways. Either by a snapvault.toml file
(containing url=<connection-string>), or by setting the environment variable
$DATABASE_URL=<connection-string>, or by passing it as a flag via --url=<connection-string>.
The --url flag will always override any of the other ways of specifying the URL. If both a
snapvault.toml file is present and $DATABASE_URL is set, then the sv.toml file will be prioritised.
`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type DBConfig struct {
}

const ENV_NAME = "DATABASE_URL"
const TOML_FILE_NAME = "sv.toml"
const TOML_FILE_NAME = "snapvault.toml"

func configFromEnv() (config DBConfig, exists bool) {
val, exists := os.LookupEnv(ENV_NAME)
Expand Down
6 changes: 3 additions & 3 deletions tests/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ func TestCoreCommands(t *testing.T) {
if err != nil {
t.Error(err)
}
t.Log("Saved fresh")
t.Log("Saved `fresh`")

err = commands.Restore(*e, "fresh")
if err != nil {
t.Error(err)
}
t.Log("Restored fresh")
t.Log("Restored `fresh`")

res, err := commands.List(*e)
if len(res) != 1 {
Expand All @@ -47,5 +47,5 @@ func TestCoreCommands(t *testing.T) {
if err != nil {
t.Error(err)
}
t.Log("Deleted fresh")
t.Log("Deleted `fresh`")
}

0 comments on commit 00f8001

Please sign in to comment.