Skip to content
Permalink
Browse files

Add clipboard clearing, only tested on linux where xsel does not keep…

… track of clipboard content...
  • Loading branch information...
Raggaer committed Feb 23, 2019
1 parent 224c349 commit d4c72e6406f65665b799c7655f0e3e8b16304a5e
Showing with 14 additions and 0 deletions.
  1. +1 −0 README.md
  2. +13 −0 command.go
@@ -40,6 +40,7 @@ You can use the `help` command while a database is opened to view the list of co
- `show` Shows an entry from the current working group
- `search` Searches entries (by title) from the current working group
- `save` Saves the database to disk
- `xx` Clears the clipboard

## Deleting groups and entries

@@ -3,6 +3,8 @@ package main
import (
"fmt"
"strings"

"github.com/atotto/clipboard"
)

type command struct {
@@ -138,6 +140,12 @@ var commands = []command{
Help: "Modifies an entry (edit <path|number>)",
HelpSmall: "Modifies an entry (edit <path|number>)",
},
{
Key: "xx",
Fn: xx,
Help: "Clears the clipboard",
HelpSmall: "Clears the clipboard",
},
}

func handleUserInput(input string) {
@@ -171,6 +179,11 @@ func exit(args []string) {
close(quit)
}

// Command "xx" clears the clipboard
func xx(args []string) {
clipboard.WriteAll("")
}

// Command "help" shows the list of commands
func help(args []string) {
// Check if we want help about a command

0 comments on commit d4c72e6

Please sign in to comment.
You can’t perform that action at this time.