#text #show #cli #file #txt

bin+lib overlap

一个工具用于显示文件中的重叠文本

2个版本

0.0.2 2019年2月11日
0.0.1 2019年2月11日

#1749 in 文本处理

Apache-2.0

13KB
264

Overlap

pipeline coverage

一个工具用于显示文件中的重叠文本。

它的工作方式几乎与

% find a.txt b.txt | xargs  cat | \
> awk -F '\n' '{d[$1]++} END {for (n in d) {print n,d[n]}}' | grep 2 | cut -d ' ' -f 1

仓库

https://gitlab.com/grauwoelfchen/overlap

安装

% cargo install overlap

# or clone and build
% git clone https://github.com/grauwoelfchen/overlap.git && cd overlap
% make install

用法

% overlap --file FILE --file FILE --file FILE ...

有一个示例。

% cat a.txt
Hoi!
Hoi Zäme!
Grüezi wohl!
% cat b.txt
Hallo!
Moin moin!
Grüezi mitenand!
Hoi!
% overlap --file a.txt --file b.txt
Hoi!

关于其他选项,请查看 overlap --help

构建

检查 make help

# debug build
% make build:debug
% docker build -t grauwoelfchen/overlap:latest .
% docker container run -i --rm \
  -v $(pwd)/tmp \
  grauwoelfchen/overlap:latest \
  --file /tmp/a.txt --file /tmp/b.txt
Hoi!

开发

审查

# check code using all vet:xxx targets
% make vet:all

测试

% make test

覆盖率

cov 需要 kcov。

# (optional)
% .tools/setup-kcov

% make coverage

CI

使用 gitlab-runner 在本地 docker 容器(Gentoo Linux)上运行 CI 任务。
.gitlab-ci.yml

# install gitlab-runner into .tools
% .tools/setup-gitlab-runner

# prepare environment variables for CI via .env.ci
% cp .env.ci.sample .env

# e.g. test (see .gitlab-ci.yml)
% .tools/ci-runner test

许可证

Overlap
Copyright 2019 Yasuhiro Яша Asaka

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://apache.ac.cn/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

依赖关系

~750KB