From dc1701625f8a994ff56dac0bd163db94dde26504 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Sun, 29 Aug 2021 16:43:51 +0200
Subject: Add man page
---
Makefile | 10 +++++++++
doc/incdec.7 | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
doc/incdec.7.txt | 35 ++++++++++++++++++++++++++++++++
3 files changed, 107 insertions(+)
create mode 100644 doc/incdec.7
create mode 100644 doc/incdec.7.txt
diff --git a/Makefile b/Makefile
index ac5b589..921fb82 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,9 @@
# along with Incdec. If not, see .
+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
+.\" 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'
--
cgit v1.2.3