File: custom.go

package info (click to toggle)
golang-github-zyedidia-clipper 0.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: makefile: 3
file content (23 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package clipper

import (
	"os/exec"
)

type Custom struct {
	Name string
}

func (c *Custom) Init() error {
	return verify(c, c.Name)
}

func (c *Custom) ReadAll(reg string) ([]byte, error) {
	cmd := exec.Command(c.Name, "-o", reg)
	return cmd.Output()
}

func (c *Custom) WriteAll(reg string, p []byte) error {
	cmd := exec.Command(c.Name, "-i", reg)
	return write(cmd, p)
}