Skip to content

Commit

Permalink
Added bash completion and updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijamt committed Oct 11, 2019
1 parent d211a31 commit ed00141
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ snapcrafts:
Simple tool that allows you to use vault in a way that's not possible from the UI or the command line,
like recursive searching, tree and recursive delete.
grade: stable
confinement: classic
confinement: strict
publish: true
plugs:
personal-files:
read:
- $HOME/.vault-token

brews:
- github:
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Usage:
vht [command]

Available Commands:
completion Generates bash completion scripts
delete Delete a path recursively
help Help about any command
search Search in the secrets data
Expand All @@ -37,3 +38,25 @@ Flags:

Use "vht [command] --help" for more information about a command.
```

## Install

### Pre-compiled binary

#### manually

Download the pre-compiled binaries from the [releases](https://github.com/ilijamt/vht/releases) page and copy to the desired location.

#### macos (homebrew)

```bash
brew tap ilijamt/tap
brew install vht
```

#### snapcraft

```bash
snap install vht
```

27 changes: 27 additions & 0 deletions cmd/vht/cmd/completion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"github.com/spf13/cobra"
)

// completionCmd represents the completion command
var completionCmd = &cobra.Command{
Use: "completion",
Short: "Generates bash completion scripts",
Long: `To load completion run
. <(vht completion)
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
. <(vht completion)
`,
Run: func(cmd *cobra.Command, args []string) {
_ = rootCmd.GenBashCompletion(cmd.OutOrStdout());
},
}

func init() {
rootCmd.AddCommand(completionCmd)
}

0 comments on commit ed00141

Please sign in to comment.