gwatch

command module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 13 Imported by: 0

README

gwatch

gwatch is a tool to execute a program periodically, and show the output changes over time. gwatch can highlight the differences between successive updates.

screencast

Usage

Usage:
  gwatch [options] command

Application Options:
  -e, --errexit   exit if command has a non-zero exit
  -n, --interval= time in seconds to wait between updates (default: 2.0)
  -t, --no-title  turn off header
  -x, --exec      pass command to exec instead of "sh -c"
  -s, --style=    interpret color and style sequences
  -v, --version   output version information and exit

Help Options:
  -h, --help      Show this help message

Keybinding

  • d: Change highlight mode between [NONE, CHAR, WORD, LINE].
  • p: Pause and resume command execution.
  • ?: Show help message.
  • q: Quit.
  • h, Left: Move left.
  • l, Right: Move right.
  • j, Down: Move down.
  • k, Up: Move up.
  • g, Home: Move to the top.
  • G, End: Move to the bottom.
  • Ctrl-f, PageDown: Move down by one page.
  • Ctrl-b, PageUp: Move up by one page.

Examples

To watch the contents of a directory change, you could use

$ gwatch ls -l

To see the interface counters, you could use

$ gwatch -n 1 ip -s link show

You can apply your own style to highlight the output changes with the color tag

$ gwatch -s red ls -l

The full definition of a color tag is as follows:

<foreground>:<background>:<flags>

Color tags may contain not just the foreground color but also the background color and additional flags. You can specify the following flags. Please refer to the rivo/tview for details.

l: blink
b: bold
d: dim
r: reverse (switch foreground and background color)
u: underline

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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