commit 1bed1901aa301b7806971419682e1988f03f188b
parent fdc740cdc0a9b40ecf87297e0c9d9b438520d966
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Thu, 7 Jan 2021 15:21:28 -0800
Fill out manual and update default command bindings
Diffstat:
M | config.def.h | | | 8 | ++++---- |
M | gawk.1 | | | 106 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- |
2 files changed, 101 insertions(+), 13 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -19,6 +19,7 @@ static char const *const separators[] = {
static const struct bind itembinds[] = {
/* name, function */
+ { 'P', cprintv },
{ 'e', cextern },
{ 'f', cfetch },
{ 'g', cgoto },
@@ -26,13 +27,12 @@ static const struct bind itembinds[] = {
{ 'p', cprint },
{ 'r', frange },
{ 's', fstring },
- { 't', ftype },
- { 'v', cprintv }
+ { 't', ftype }
};
static const struct bind binds[] = {
/* name, function */
- { 'u', sunwind },
{ 'G', sgoto },
- { 'q', sexit }
+ { 'q', sexit },
+ { 'u', sunwind }
};
diff --git a/gawk.1 b/gawk.1
@@ -1,21 +1,109 @@
+.de NN
+.PP
+.BR \\$1 \" display full name [ \\$2 ]
+..
+.de II
+.br
+..
.TH GAWK 1 2020.12.21
.SH NAME
-gawk \(em gawk at gopherholes
+.B gawk
+\(em gawk at gopherholes
.SH SYNOPSIS
-gawk
+.B gawk
.RI [ path
.RI [ host
.RI [ port ]]]
.SH DESCRIPTION
-gawk is a gopher client which utilizes the standard input for input
-making it easy to script, simple and clean.
+.B gawk
+is a gopher (see
+.BR STANDARDS )
+client which uses filtering instead of navigation making for a
+pleasant interface.
.SH USAGE
-These sections will be filled out when I'm more sure of the defaults.
.SS Syntax
-There are three separators (see config.h), the first for statements,
-the second commands and the third arguments.
-.SS Commands
-See config.h for bindings and commands.h for definitions.
+.PP
+Statements are separated by semi-colen `;' and newline `\\n'.
+Statement commands are separated by bar `|'. Command arguments are
+separated by space ` ' and tab `\\t'.
+.PP
+If a statement consists of multiple commands this forms a pipeline,
+each command will either pass or skip it's input item, if a command
+is negated by prefixing it's name with an exclamation point `!'
+this effect is reversed.
+.IP
+.B note:
+Only item commands (see below) can form a pipeline.
+.SS
+Commands
+.NN "G" "oto"
+.RI [ path " [" host " [" port ]]]
+.II
+Go to the location specified by it's arguments, lacking arguments
+are replaced by their current values.
+.NN "q" "uit"
+.II
+Equivalent to
+.I u
+with an argument of the current depth.
+.NN "u" "nwind"
+.BA n
+.II
+Unwind the stack by
+.IR n .
+.SS
+Item commands
+.NN "P" "rint"
+.II
+Wrapper around the `p' command which writes extra information about
+each item.
+.NN "e" "xtern"
+.I program
+.RI [ argument... ]
+.II
+Run
+.I program
+in the background with each argument consisting of solely `%'
+replaced by
+.IR host / path .
+.NN "f" "etch"
+.RI [ path ]
+.II
+Fetch each input item to
+.I path
+or, if lacking, the basename of the remote path.
+.NN "g" "oto"
+.RI [ query ]
+.II
+Go to the location specified by it's input item, if the item is of
+type 7 the op
+.NN "i" "ndex"
+.I n...
+.II
+Only pass items with an index matching one of the given indexes,
+.IR n .
+.NN "p" "rint"
+.II
+The `p' command formats it's input writing it to stdout.
+.NN "r" "ange"
+.RI ( "low high" )...
+.II
+Only pass items with an index within one of the ranges
+.IR low - high .
+.NN "s" "tring"
+.I substring...
+.II
+Only pass items if their info field gets matched by all
+.I substring
+arguments.
+.NN "t" "ype"
+.I types
+.II
+Pass items if their type is one of the types listed in
+.IR types .
+.SH CONFIGURATION
+Configuration is done by creating a costom config.h and (re)compiling
+the source code.
.SH STANDARDS
.I Internet RFC 1436
.SH AUTHOR