Skip to content

Commit

Permalink
Move docs (csv.md, cover.md, cover.png) to docs/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoyt committed Oct 24, 2022
1 parent d9ffa58 commit 84e5b68
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

AWK is a fascinating text-processing language, and somehow after reading the delightfully-terse [*The AWK Programming Language*](https://ia802309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoIC7/The_AWK_Programming_Language.pdf) I was inspired to write an interpreter for it in Go. So here it is, feature-complete and tested against "the one true AWK" and GNU AWK test suites.

GoAWK is a POSIX-compatible version of AWK, and additionally has a CSV mode for reading and writing CSV and TSV files. This feature was sponsored by the [library of the University of Antwerp](https://www.uantwerpen.be/en/library/). Read the [CSV documentation](https://github.com/benhoyt/goawk/blob/master/csv.md).
GoAWK is a POSIX-compatible version of AWK, and additionally has a CSV mode for reading and writing CSV and TSV files. This feature was sponsored by the [library of the University of Antwerp](https://www.uantwerpen.be/en/library/). Read the [CSV documentation](https://github.com/benhoyt/goawk/blob/master/docs/csv.md).

You can also read one of the articles I've written about GoAWK:

Expand Down Expand Up @@ -92,7 +92,7 @@ The intention is for GoAWK to conform to `awk`'s behavior and to the [POSIX AWK

Additional features GoAWK has over AWK:

* It has proper support for CSV and TSV files ([read the documentation](https://github.com/benhoyt/goawk/blob/master/csv.md)).
* It has proper support for CSV and TSV files ([read the documentation](https://github.com/benhoyt/goawk/blob/master/docs/csv.md)).
* It supports negative field indexes to access fields from the right, for example, `$-1` refers to the last field.
* It's embeddable in your Go programs! You can even call custom Go functions from your AWK scripts.
* Most AWK scripts are faster than `awk` and on a par with `gawk`, though usually slower than `mawk`. (See [recent benchmarks](https://benhoyt.com/writings/goawk-compiler-vm/#virtual-machine-results).)
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion goawk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ age,email,name Sarah 25
}

func TestCSVDocExamples(t *testing.T) {
f, err := os.Open("csv.md")
f, err := os.Open("docs/csv.md")
if err != nil {
t.Fatalf("error opening examples file: %v", err)
}
Expand Down
1 change: 0 additions & 1 deletion internal/ast/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func WalkStmtList(v Visitor, stmts []Stmt) {
// v.Visit(node) is not nil, Walk is invoked recursively with visitor
// w for each of the non-nil children of node, followed by a call of
// w.Visit(nil).
//
func Walk(v Visitor, node Node) {
if node == nil {
return
Expand Down
4 changes: 2 additions & 2 deletions interp/interp.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ type Config struct {
// You can also enable CSV or TSV input mode by setting INPUTMODE to "csv"
// or "tsv" in Vars or in the BEGIN block (those override this setting).
//
// For further documentation about GoAWK's CSV support, see the full docs:
// https://github.com/benhoyt/goawk/blob/master/csv.md
// For further documentation about GoAWK's CSV support, see the full docs
// in "../docs/csv.md".
InputMode IOMode

// Additional options if InputMode is CSVMode or TSVMode. The zero value
Expand Down
12 changes: 6 additions & 6 deletions scripts/make_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ go build
VERSION="$(./goawk -version)"

GOOS=windows GOARCH=386 go build -ldflags="-w"
zip "goawk_${VERSION}_windows_386.zip" goawk.exe README.md csv.md LICENSE.txt
zip "goawk_${VERSION}_windows_386.zip" goawk.exe README.md LICENSE.txt docs/*
GOOS=windows GOARCH=amd64 go build -ldflags="-w"
zip "goawk_${VERSION}_windows_amd64.zip" goawk.exe README.md csv.md LICENSE.txt
zip "goawk_${VERSION}_windows_amd64.zip" goawk.exe README.md LICENSE.txt docs/*

GOOS=linux GOARCH=386 go build -ldflags="-w"
tar -cvzf "goawk_${VERSION}_linux_386.tar.gz" goawk README.md csv.md LICENSE.txt
tar -cvzf "goawk_${VERSION}_linux_386.tar.gz" goawk README.md LICENSE.txt docs/*
GOOS=linux GOARCH=amd64 go build -ldflags="-w"
tar -cvzf "goawk_${VERSION}_linux_amd64.tar.gz" goawk README.md csv.md LICENSE.txt
tar -cvzf "goawk_${VERSION}_linux_amd64.tar.gz" goawk README.md LICENSE.txt docs/*

GOOS=darwin GOARCH=amd64 go build -ldflags="-w"
tar -cvzf "goawk_${VERSION}_darwin_amd64.tar.gz" goawk README.md csv.md LICENSE.txt
tar -cvzf "goawk_${VERSION}_darwin_amd64.tar.gz" goawk README.md LICENSE.txt docs/*
GOOS=darwin GOARCH=arm64 go build -ldflags="-w"
tar -cvzf "goawk_${VERSION}_darwin_arm64.tar.gz" goawk README.md csv.md LICENSE.txt
tar -cvzf "goawk_${VERSION}_darwin_arm64.tar.gz" goawk README.md LICENSE.txt docs/*

rm -f goawk goawk.exe

0 comments on commit 84e5b68

Please sign in to comment.