Skip to content

Commit

Permalink
Merge pull request #8 from tamada/release/v0.9.6
Browse files Browse the repository at this point in the history
ready to release v0.9.6
  • Loading branch information
tamada committed Aug 23, 2022
2 parents 16e700d + d012168 commit ae0a880
Show file tree
Hide file tree
Showing 17 changed files with 345 additions and 127 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GO=go
SHELL=/bin/bash
VERSION := 0.9.5
VERSION := 0.9.6
NAME := peripherals
DIST := $(NAME)-$(VERSION)

Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# peripheral utility commands

[![build](https://github.com/tamada/peripherals/actions/workflows/build.yaml/badge.svg)](https://github.com/tamada/peripherals/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/tamada/peripherals/badge.svg?branch=main)](https://coveralls.io/github/tamada/peripherals?branch=main)
[![codebeat badge](https://codebeat.co/badges/57405211-d149-4be5-9f9b-bfe72144b058)](https://codebeat.co/projects/github-com-tamada-peripherals-main)
[![Go Report Card](https://goreportcard.com/badge/github.com/tamada/peripherals)](https://goreportcard.com/report/github.com/tamada/peripherals)

[![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/tamada/peripherals/blob/main/LICENSE)
[![Version](https://img.shields.io/badge/Version-v0.9.5-green)](https://github.com/tamada/btmeister/releases/tag/v0.9.5)
[![Version](https://img.shields.io/badge/Version-v0.9.6-green)](https://github.com/tamada/btmeister/releases/tag/v0.9.6)

[![Homebrew](https://img.shields.io/badge/Homebrew-tamada/brew/peripherals-yellow?logo=homebrew)](https://github.com/tamada/btmeister/releases/tag/v0.9.6)

peripheral utility commands for the shell by contrasting [GNU coreutils](https://www.gnu.org/software/coreutils/).

## How to install

This project supports Homebrew.


```sh
brew tap tamada/brew
brew install peripherals
Expand Down Expand Up @@ -134,4 +144,4 @@ combined operation
## License
* MIT License
[![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/tamada/peripherals/blob/main/LICENSE)
2 changes: 1 addition & 1 deletion peripherals.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
)

const VERSION = "0.9.5"
const VERSION = "0.9.6"

func Version(appName string) string {
return fmt.Sprintf("%s version %s", appName, VERSION)
Expand Down
6 changes: 3 additions & 3 deletions peripherals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package peripherals
import "testing"

func TestVersion(t *testing.T) {
if VERSION != "0.9.5" {
t.Errorf("mismatch version wont %s, but got %s", "0.9.5", VERSION)
if VERSION != "0.9.6" {
t.Errorf("mismatch version wont %s, but got %s", "0.9.6", VERSION)
}
wontVersion := "tamada/peripherals version 0.9.5"
wontVersion := "tamada/peripherals version 0.9.6"
gotVersion := Version("tamada/peripherals")
if wontVersion != gotVersion {
t.Errorf("mismatch version information wont %s, but got %s", wontVersion, gotVersion)
Expand Down
3 changes: 3 additions & 0 deletions ptest/ptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,5 +288,8 @@ func (e *Expression) Term() (bool, error) {
return c != "", nil
}
item2, ok := e.next()
if !ok {
return false, fmt.Errorf("%s: parse error", e.Original)
}
return e.compare(c, item2, opts)
}
Empty file added site/.hugo_build.lock
Empty file.
13 changes: 7 additions & 6 deletions site/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
PWD := ${CURDIR}
CONTAINER_NAME := "wwwuniq2"
CONTAINER_LABEL := "wwwperipherals"
CONTAINER_REMOVE_FLAG := "--rm"
BASE_URL := "https://tamada.github.io/uniq2"
JOJOMI_VERSION := 0.69.0
CONTAINER_NAME := "klakegg/hugo"
CONTAINER_VERSION := latest
BASE_URL := "https://tamada.github.io/peripherals"

build:
docker run ${CONTAINER_REMOVE_FLAG} --name ${CONTAINER_NAME}_build -v "${PWD}":/src -v ${PWD}/public:/output -e HUGO_THEME=cayman-hugo-theme -e HUGO_BASEURL=${BASE_URL} jojomi/hugo:${JOJOMI_VERSION}
docker run ${CONTAINER_REMOVE_FLAG} --name ${CONTAINER_LABEL}_build -v "${PWD}":/src -v ${PWD}/public:/output -e HUGO_THEME=cayman-hugo-theme -e HUGO_BASEURL=${BASE_URL} ${CONTAINER_NAME}:${CONTAINER_VERSION}

start:
docker run ${CONTAINER_REMOVE_FLAG} -d --name ${CONTAINER_NAME} -p 1313:1313 -v "${PWD}":/src -v "$(PWD)"/public:/output -e HUGO_THEME=cayman-hugo-theme -e HUGO_WATCH="true" -e HUGO_BASEURL=${BASE_URL} jojomi/hugo:${JOJOMI_VERSION}
docker run ${CONTAINER_REMOVE_FLAG} -d --name ${CONTAINER_LABEL} -p 1313:1313 -v "${PWD}":/src -v "$(PWD)"/public:/output -e HUGO_THEME=cayman-hugo-theme -e HUGO_WATCH="true" -e HUGO_BASEURL=${BASE_URL} ${CONTAINER_NAME}:${CONTAINER_VERSION}

stop:
docker stop ${CONTAINER_NAME}
docker stop ${CONTAINER_LABEL}
3 changes: 2 additions & 1 deletion site/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pygmentsStyle = "pygments"

[params]
project_name = "peripherals"
project_tagline = "Peripherals utility commands for the shell"
project_tagline = "Peripheral Utility Commands for the Shell Environment"
project_logo = "images/logo.svg"
dateFormat = "2006-01-02"

footer = "[![GitHub](https://img.shields.io/badge/GitHub-tamada/peripherals-blueviolet.svg?logo=github)](https://github.com/tamada/peripherals) Made with [Hugo](https://gohugo.io/). Theme by [Cayman](https://github.com/zwbetz-gh/cayman-hugo-theme). Deployed to [GitHub Pages](https://pages.github.com/)."
Expand Down
62 changes: 17 additions & 45 deletions site/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,27 @@
title: peripherals
---

[![Build Status](https://github.com/tamada/uniq2/workflows/build/badge.svg?branch=master)](https://github.com/tamada/uniq2/actions?workflow=build)
[![Coverage Status](https://coveralls.io/repos/github/tamada/uniq2/badge.svg?branch=master)](https://coveralls.io/github/tamada/uniq2?branch=master)
[![codebeat badge](https://codebeat.co/badges/855266ea-99d4-4d80-ac43-81a1712f0f90)](https://codebeat.co/projects/github-com-tamada-uniq2-master)
[![Go Report Card](https://goreportcard.com/badge/github.com/tamada/uniq2)](https://goreportcard.com/report/github.com/tamada/uniq2)
[![License](https://img.shields.io/badge/License-WTFPL-blue.svg)](https://github.com/tamada/uniq2/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/Version-1.1.1-yellowgreen.svg)](https://github.com/tamada/uniq2/releases/tag/v1.1.1)
[![build](https://github.com/tamada/peripherals/actions/workflows/build.yaml/badge.svg)](https://github.com/tamada/peripherals/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/tamada/peripherals/badge.svg?branch=main)](https://coveralls.io/github/tamada/peripherals?branch=main)
[![codebeat badge](https://codebeat.co/badges/57405211-d149-4be5-9f9b-bfe72144b058)](https://codebeat.co/projects/github-com-tamada-peripherals-main)

## Description
[![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/tamada/peripherals/blob/main/LICENSE)
[![Version](https://img.shields.io/badge/Version-v0.9.5-green)](https://github.com/tamada/btmeister/releases/tag/v0.9.5)

Delete duplicated lines.
[![Homebrew](https://img.shields.io/badge/Homebrew-tamada/brew/peripherals-yellow?logo=homebrew)](https://github.com/tamada/btmeister/releases/tag/v${VERSION})

GNU core utilities have `uniq` command for deleting duplicate lines.
However, `uniq` command deletes only continuous duplicate lines.
When deleting not continuous duplicate lines, we use `sort` command together, in that case, the order of the list was not kept.
## :speaking_head: Description

We want to delete not continuous duplicated lines with remaining the order.
Peripheral utility commands for the shell by contrasting [GNU coreutils](https://www.gnu.org/software/coreutils/).
This product includes the following commands.

### Install by Homebrew
* [`puniq`](usage#puniq)
* deletes the duplicated lines.
* [`ptake`](usage#ptake)
* print lines while satisfying the predicate.
* [`pskip`](usage#pskip)
* skip lines while satisfying the predicate.
* [`ptest`](usage#ptest)
* another implementation of `test` command.

Simply type the following commands.

```bash
$ brew tap tamada/brew # <- only the first time
$ brew install uniq2
```

### Install by Go

Simply type the following command.

```sh
$ go get github.com/tamada/uniq2
```

## Usage

```
uniq2 [OPTIONS] [INPUT [OUTPUT]]
OPTIONS
-a, --adjacent delete only adjacent duplicated lines.
-d, --delete-lines only prints deleted lines.
-i, --ignore-case case sensitive.
-h, --help print this message.
INPUT gives file name of input. If argument is single dash ('-')
or absent, the program read strings from stdin.
OUTPUT represents the destination.
```

## License

[WTFPL](https://github.com/tamada/uniq2/blob/master/LICENSE)
6 changes: 6 additions & 0 deletions site/content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ title: ":smile: About the Project"

* Haruaki Tamada

## Project

### Project Icon

![logo](/peripherals/images/logo.svg)

65 changes: 0 additions & 65 deletions site/content/demo.md

This file was deleted.

37 changes: 37 additions & 0 deletions site/content/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: ":anchor: Install"
---

### :beer: Install by Homebrew

Simply type the following commands.

```bash
$ brew tap tamada/brew # <- only the first time
$ brew install peripherals
```

### Install by Go

Simply type the following command.

```sh
$ go get github.com/tamada/peripherals
```

### :muscle: Install your self

1. Clone the project `tamada/peripherals` from [GitHub](https://github.com/tamada/peripherals).
2. Go to the cloned `peripherals` directory.
3. Compile the codes in the project.
4. Move executables in to some directory for execution.

To do above items, run the following commands.

```sh
$ git clone https://github.com/tamada/peripherals.git
$ cd peripherals
$ make
$ cp cmd/* /usr/local/bin
```

Loading

0 comments on commit ae0a880

Please sign in to comment.