update: makefile

This commit is contained in:
Inanc Gumus
2019-08-08 17:19:20 +03:00
parent e4dae5e0d4
commit 43d25a4180
2 changed files with 27 additions and 15 deletions

View File

@ -1,25 +1,29 @@
SHELL := /bin/bash SHELL := /bin/bash
LINES = echo -e ">> log.txt has $$(wc -l log.txt | cut -f1 -d' ') lines" LINES = $$(wc -l log.txt | cut -f1 -d' ')
ECHO_LINES = echo -e ">> log.txt has $(LINES) lines"
ifeq ($(n),) s:
n := 18
endif
s:
time go run . < log.txt time go run . < log.txt
r: r:
go run . < log.txt go run . < log.txt
# make n=18 n ?= 18
load: restore load: restore
@echo "enlarging the file with itself, please wait..." @echo "enlarging the file with itself, please wait..."
@for i in {1..$(n)}; do awk 1 log.txt log.txt > log_.txt; mv log_.txt log.txt; rm -f log_.txt; done
@$(LINES) @for i in {1..$(n)}; do \
awk 1 log.txt log.txt > log_.txt; \
mv log_.txt log.txt; \
rm -f log_.txt; \
done
@$(ECHO_LINES)
restore: restore:
@$(LINES) @echo "restoring the file..."
git checkout log.txt @git checkout log.txt
@$(ECHO_LINES)
lines: lines:
@$(LINES) @$(ECHO_LINES)

View File

@ -41,6 +41,14 @@ Result -> report.Line
notUsing = report.Not notUsing = report.Not
pl := newPipeline(pipeOpts{
from: fastTextReader(os.Stdin),
filterBy: notUsing(domainExtFilter("com", "io")),
groupBy: domainGrouper,
})
err := pl.start()
_, err := report.New(). _, err := report.New().
From(report.TextReader(os.Stdin)). From(report.TextReader(os.Stdin)).
To(report.TextWriter(os.Stdout)). To(report.TextWriter(os.Stdout)).