You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-15Lines changed: 50 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,42 @@
6
6
7
7
**gocat** is a super simple command line program for concatenating files. **gocat** supports the following operating systems and architectures.
8
8
9
+
## Platforms
10
+
11
+
The following platforms are supported. Pull requests to support other platforms are welcome!
12
+
9
13
| GOOS | GOARCH |
10
14
| ---- | ------ |
11
15
| darwin | amd64 |
12
16
| linux | amd64 |
13
17
| windows | amd64 |
14
18
| linux | arm64 |
15
19
16
-
# Installation
20
+
## Releases
21
+
22
+
Find releases at [https://github.com/spatialcurrent/gocat/releases](https://github.com/spatialcurrent/gocat/releases). You might want to rename your binary to just `gocat` (or `cat`) for convenience. See the **Building** section below to build from scratch.
23
+
24
+
**Darwin**
25
+
26
+
-`gocat_darwin_amd64` - CLI for Darwin on amd64 (includes `macOS` and `iOS` platforms)
17
27
18
-
No installation is required. Just grab a [release](https://github.com/spatialcurrent/gocat/releases). You might want to rename your binary to just `gocat` (or `cat`) for convenience.
28
+
**Linux**
19
29
20
-
If you do have go already installed, you can just run using `go run main.go` or install with `make install`
30
+
-`gocat_linux_amd64` - CLI for Linux on amd64
31
+
-`gocat_linux_amd64` - CLI for Linux on arm64
21
32
22
-
# Usage
33
+
**Windows**
34
+
35
+
-`gocat_windows_amd64.exe` - CLI for Windows on amd64
36
+
37
+
## Usage
23
38
24
39
See the usage below or the following examples.
25
40
26
41
```shell
27
-
gocat is a super simple utility to concatenate files (local, remote, or on AWS S3) provided as positional arguments. Supports stdin (aka "-"), local files (path/to/file or file://path/to/file), remote files (http://path/to/file), or files on AWS S3 (s3://path/to/file).
42
+
gocat is a super simple utility to concatenate files (local, remote, or on AWS S3) provided as positional arguments.
43
+
Supports stdin (aka "-"), local files (path/to/file or file://path/to/file), remote files (http://path/to/file), or files on AWS S3 (s3://path/to/file).
44
+
Supports the following compression algorithms: bzip2, flate, gzip, none, snappy, zip, zlib
28
45
29
46
Usage:
30
47
gocat [flags] [-|stdin|FILE|URI]...
@@ -41,42 +58,60 @@ Flags:
41
58
-h, --help helpfor gocat
42
59
```
43
60
44
-
# Examples
61
+
##Examples
45
62
46
-
**Shell**
63
+
### Shell
47
64
48
65
```shell
49
66
gocat "~/.bash_aliases""~/.bashrc"
50
67
```
51
68
52
-
**Remote File**
69
+
### Remote File
53
70
54
71
`gocat` arguments can point to remote files
55
72
56
73
```shell
57
74
gocat https://spatialcurrent.io
58
75
```
59
76
60
-
**All Files With Extension**
77
+
### All Files With Extension
61
78
62
79
`gocat` will print every file given as a positional argument, which can be useful when looking through thousands of files.
63
80
64
81
```shell
65
82
gocat $( find . -print | grep -i '.*[.]md')
66
83
```
67
84
68
-
# Building
85
+
## Building
86
+
87
+
Use `make help` to see help information for each target.
88
+
89
+
**CLI**
69
90
70
-
You can build all the released artifacts using `make build` or run the make target for a specific operating system and architecture.
91
+
The `make build_cli` script is used to build executables for Linux and Windows. Use `make install` for standard installation as a go executable.
92
+
93
+
**Changing Destination**
94
+
95
+
The default destination for build artifacts is `go-reader-writer/bin`, but you can change the destination with an environment variable. For building on a Chromebook consider saving the artifacts in `/usr/local/go/bin`, e.g., `DEST=/usr/local/go/bin make build_cli`
96
+
97
+
## Testing
98
+
99
+
**CLI**
100
+
101
+
To run CLI testes use `make test_cli`, which uses [shUnit2](https://github.com/kward/shunit2). If you recive a `shunit2:FATAL Please declare TMPDIR with path on partition with exec permission.` error, you can modify the `TMPDIR` environment variable in line or with `export TMPDIR=<YOUR TEMP DIRECTORY HERE>`. For example:
102
+
103
+
```
104
+
TMPDIR="/usr/local/tmp" make test_cli
105
+
```
71
106
72
-
# Testing
107
+
**Go**
73
108
74
-
Run test using `bash scripts/test.sh`or `make test`, which runs unit tests, `go vet`, `go vet with shadow`, [errcheck](https://github.com/kisielk/errcheck), [ineffassign](https://github.com/gordonklaus/ineffassign), [staticcheck](https://staticcheck.io/), and [misspell](https://github.com/client9/misspell).
109
+
To run Go tests use `make test_go` (or `bash scripts/test.sh`), which runs unit tests, `go vet`, `go vet with shadow`, [errcheck](https://github.com/kisielk/errcheck), [ineffassign](https://github.com/gordonklaus/ineffassign), [staticcheck](https://staticcheck.io/), and [misspell](https://github.com/client9/misspell).
75
110
76
-
# Contributing
111
+
##Contributing
77
112
78
113
[Spatial Current, Inc.](https://spatialcurrent.io) is currently accepting pull requests for this repository. We'd love to have your contributions! Please see [Contributing.md](https://github.com/spatialcurrent/gocat/blob/master/CONTRIBUTING.md) for how to get started.
79
114
80
-
# License
115
+
##License
81
116
82
117
This work is distributed under the **MIT License**. See **LICENSE** file.
Long: `gocat is a super simple utility to concatenate files (local, remote, or on AWS S3) provided as positional arguments. Supports stdin (aka "-"), local files (path/to/file or file://path/to/file), remote files (http://path/to/file), or files on AWS S3 (s3://path/to/file).`,
76
+
Short: "gocat is a super simple utility to concatenate files (local, remote, or on AWS S3) provided as positional arguments.",
77
+
Long: `gocat is a super simple utility to concatenate files (local, remote, or on AWS S3) provided as positional arguments.
78
+
Supports stdin (aka "-"), local files (path/to/file or file://path/to/file), remote files (http://path/to/file), or files on AWS S3 (s3://path/to/file).
79
+
Supports the following compression algorithms: `+strings.Join(grw.Algorithms, ", "),
0 commit comments