Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wcygan/go-coreutils
A Go implementation of gnu-coreutils programs
https://github.com/wcygan/go-coreutils
coreutils coreutils-programs
Last synced: about 2 months ago
JSON representation
A Go implementation of gnu-coreutils programs
- Host: GitHub
- URL: https://github.com/wcygan/go-coreutils
- Owner: wcygan
- License: mit
- Created: 2022-01-15T18:00:55.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-02T20:20:34.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T06:22:23.364Z (7 months ago)
- Topics: coreutils, coreutils-programs
- Language: Go
- Homepage: https://www.gnu.org/software/coreutils/manual/coreutils.html
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Go-Coreutils
A Go implementation of gnu-coreutils programs (https://www.gnu.org/software/coreutils/manual/coreutils.html)
## Installation via [Go](https://go.dev/dl/)
Install on any platform using `go get`:
```
$ go get github.com/wcygan/go-coreutils
```## How to run
Once the binary is installed, use the `go-coreutils` program like so:
```
$ go-coreutils
A Go implementation of gnu-coreutils programs - https://www.gnu.org/software/coreutils/Usage:
go-coreutils [command]Available Commands:
completion Generate the autocompletion script for the specified shell
du Disk Usage
echo Print a line of text
help Help about any command
ls List directory contents
ping Tests the reachability of a host on a network
pwd Print working directory
tree Display a directory tree
whoami Print effective user name
yes Repeats the provided text until interruptedFlags:
-h, --help help for go-coreutilsUse "go-coreutils [command] --help" for more information about a command.
```You can execute a subcommand like `tree` in the following way:
```
$ go-coreutils tree
.
├── LICENSE
├── cmd
│ ├── common.go
│ ├── du.go
│ ├── echo.go
│ ├── ls.go
│ ├── ping.go
│ ├── pwd.go
│ ├── root.go
│ ├── tree.go
│ ├── whoami.go
│ └── yes.go
├── constants
│ └── shared_constants.go
├── du
│ └── du.go
├── echo
│ ├── echo.go
│ └── echo_test.go
├── gco
├── go.mod
├── go.sum
├── ls
│ ├── ls.go
│ └── ls_test.go
├── main.go
├── ping
│ └── ping.go
├── pwd
│ ├── pwd.go
│ └── pwd_test.go
├── readme.md
├── tree
│ ├── testdir
│ │ ├── a
│ │ │ └── apple
│ │ ├── b
│ │ │ └── banana
│ │ ├── bar
│ │ ├── baz
│ │ ├── c
│ │ │ └── orange
│ │ └── foo
│ └── tree.go
├── whoami
│ ├── whoami.go
│ └── whoami_test.go
└── yes
└── yes.go```
## Add a command using [Cobra](https://cobra.dev/)
Make sure you have the Cobra generator ([Install](https://cobra.dev/#install), [Docs](https://github.com/spf13/cobra/blob/master/cobra/README.md)) installed.
With the Cobra generator you can initialize the Cobra framework, add commands & subcommands, and more.
```
$ cobra init
$ cobra add
$ cobra add
```