repin

package module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 4 Imported by: 4

README

repin build Go Reference

repin is a tool to replace strings between keyword pair.

tl;dr

repin is a tool that makes it easy to write operations that can be written in GNU sed as follows.

$ cat README.md
# Hello

```console
```

$ cat README.md | sed -z 's/```console.*```/```console\n$ echo hello world!\n```/'
# Hello

```console
$ echo hello world!
```

$
$ repin README.md -k '```console' -k '```' -r '$ echo hello world!'
# Hello

```console
$ echo hello world!
```

$

Install

deb:

Use dpkg-i-from-url

$ export REPIN_VERSION=X.X.X
$ curl -L https://git.io/dpkg-i-from-url | bash -s -- https://github.com/k1LoW/repin/releases/download/v$REPIN_VERSION/repin_$REPIN_VERSION-1_amd64.deb

RPM:

$ export REPIN_VERSION=X.X.X
$ yum install https://github.com/k1LoW/repin/releases/download/v$REPIN_VERSION/repin_$REPIN_VERSION-1_amd64.rpm

apk:

Use apk-add-from-url

$ export REPIN_VERSION=X.X.X
$ curl -L https://git.io/apk-add-from-url | sh -s -- https://github.com/k1LoW/repin/releases/download/v$REPIN_VERSION/repin_$REPIN_VERSION-1_amd64.apk

homebrew tap:

$ brew install k1LoW/tap/repin

go install:

$ go install github.com/k1LoW/repin/cmd/repin@vX.X.X

manually:

Download binary from releases page

docker:

$ docker pull ghcr.io/k1low/repin:latest

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pick added in v0.3.0

func Pick(src io.Reader, start, end string, nonl bool, out io.Writer) (int, error)

Pick strings between `start` and `end` of `src` and write `out`.

func Replace

func Replace(src, replace io.Reader, start, end string, nonl bool, out io.Writer) (int, error)

Replace strings between `start` and `end` of `src` to `replace` and write `out`.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL