aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-08-29 16:43:51 +0200
committerTeddy Wing2021-08-29 16:43:51 +0200
commitdc1701625f8a994ff56dac0bd163db94dde26504 (patch)
tree67f4d53cbcab6718ce9542a4777da46a05f94fa7
parent360a41567292184da41db27fe3ea71af8ccaabb7 (diff)
downloadreadline-incdec-dc1701625f8a994ff56dac0bd163db94dde26504.tar.bz2
Add man pagev0.0.1
-rw-r--r--Makefile10
-rw-r--r--doc/incdec.762
-rw-r--r--doc/incdec.7.txt35
3 files changed, 107 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ac5b589..921fb82 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,9 @@
# along with Incdec. If not, see <https://www.gnu.org/licenses/>.
+MAN_PAGE := doc/incdec.7
+
+
.PHONY: all
all: incdec.bash
@@ -32,3 +35,10 @@ incdec.pl: incdec.m4.pl incdec.pm
.PHONY: test
test:
prove -v
+
+
+.PHONY: doc
+doc: $(MAN_PAGE)
+
+$(MAN_PAGE): $(MAN_PAGE).txt
+ a2x --no-xmllint --format manpage $<
diff --git a/doc/incdec.7 b/doc/incdec.7
new file mode 100644
index 0000000..de0dca0
--- /dev/null
+++ b/doc/incdec.7
@@ -0,0 +1,62 @@
+'\" t
+.\" Title: incdec
+.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 08/29/2021
+.\" Manual: \ \&
+.\" Source: \ \&
+.\" Language: English
+.\"
+.TH "INCDEC" "7" "08/29/2021" "\ \&" "\ \&"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+incdec \- Readline bindings to increment and decrement numbers
+.SH "SYNOPSIS"
+.sp
+Incdec bindings
+.SH "DESCRIPTION"
+.sp
+A pair of Readline bindings and Bash functions to quickly increment and decrement a number on the current command line\&.
+.SH "BINDINGS"
+.PP
+\fB__readline_incdec_decrement (C\-x x)\fR
+.RS 4
+Decrement the first number to the left of point by one\&. If no number is on the left of point, the first number to the right of point is decremented\&.
+.RE
+.PP
+\fB__readline_incdec_increment (C\-x a)\fR
+.RS 4
+Increment the first number to the left of point by one\&. If no number is on the left of point, the first number to the right of point is incremented\&.
+.RE
+.SH "CUSTOM BINDINGS"
+.sp
+Custom bindings can be defined by mapping to the increment and decrement functions\&. For example, this defines bindings for \fIC\-x \-\fR and \fIC\-x +\fR:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+bind \-x \*(Aq"\eC\-x\-": __readline_incdec_decrement\*(Aq
+bind \-x \*(Aq"\eC\-x+": __readline_incdec_increment\*(Aq
+.fi
+.if n \{\
+.RE
+.\}
diff --git a/doc/incdec.7.txt b/doc/incdec.7.txt
new file mode 100644
index 0000000..274d865
--- /dev/null
+++ b/doc/incdec.7.txt
@@ -0,0 +1,35 @@
+incdec(7)
+=========
+
+NAME
+----
+incdec - Readline bindings to increment and decrement numbers
+
+SYNOPSIS
+--------
+Incdec bindings
+
+DESCRIPTION
+-----------
+A pair of Readline bindings and Bash functions to quickly increment and
+decrement a number on the current command line.
+
+BINDINGS
+--------
+*__readline_incdec_decrement (C-x x)*::
+ Decrement the first number to the left of point by one. If no number
+ is on the left of point, the first number to the right of point is
+ decremented.
+
+*__readline_incdec_increment (C-x a)*::
+ Increment the first number to the left of point by one. If no number
+ is on the left of point, the first number to the right of point is
+ incremented.
+
+CUSTOM BINDINGS
+---------------
+Custom bindings can be defined by mapping to the increment and decrement
+functions. For example, this defines bindings for 'C-x -' and 'C-x +':
+
+ bind -x '"\C-x-": __readline_incdec_decrement'
+ bind -x '"\C-x+": __readline_incdec_increment'