lwc-golang

module
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2018 License: MIT

README

lwc

Go Report Card Build Status Coverage Status Release

A live-updating version of the UNIX wc command.

Installation

You can get a prebuilt binary for every major platform from the Releases page. Just extract it somewhere under your PATH and you're good to go.

Alternatively, use go get to build from source:

go get -u github.com/timdp/lwc/cmd/lwc

Usage

lwc [OPTION]...

Without any options, lwc will count the number of lines, words, and bytes in standard input, and write them to standard output. Contrary to wc, it will also update standard output while it is still counting.

All the standard wc options are supported:

  • --lines or -l
  • --words or -w
  • --chars or -m
  • --bytes or -c
  • --max-line-length or -L
  • --files0-from=F
  • --help
  • --version

In addition, the output update interval can be configured by passing either --interval=TIME or -i TIME, where TIME is a duration in milliseconds. The default update interval is 100 ms.

Examples

Count the number of lines in a big file:

lwc --lines < big-file

Run a slow command and count the number of bytes logged:

slow-command | lwc --bytes

JavaScript Version

This utility briefly existed as a Node.js package. I'm keeping the code around for educational purposes, but I will no longer be maintaining it.

Author

Tim De Pauw

License

MIT

Directories

Path Synopsis
cmd
lwc command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL