Update with more install targets.
Installing headers and library to /usr/local/ Requires workaround for version information header generation Install a man page Install some basic bash completion for maps Also update the readme to fit with the manpage and new autocompletion features Fixes the oddity where generated map files were missing the initial line of the header
This commit is contained in:
parent
53e882ae12
commit
2273c93f11
8 changed files with 179 additions and 83 deletions
29
scripts/gen_manpage.sh
Executable file
29
scripts/gen_manpage.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#! /bin/bash
|
||||
# Used to a man page from markdown
|
||||
|
||||
echo ".\" Man page for the ttrts project" > $1
|
||||
echo ".\" this man page is auto-generated, do not edit directly" >> $1
|
||||
|
||||
echo ".TH TTRTS\ v0.3.0 6 $(date +%Y-%m-%d) http://mdiluz.github.io/ttrts/" >> $1
|
||||
|
||||
# sections to section headers
|
||||
# sub-sections in man page sub-sections
|
||||
# 4-space lines to tabs
|
||||
# tab starts removed
|
||||
# Environment variables in bold
|
||||
# User variables in italics
|
||||
# remove all line-widths
|
||||
# Put all back-ticks quotes in bold
|
||||
# underline mapfile opt
|
||||
# ensure name section uses correct
|
||||
cat "$2" \
|
||||
| sed -r 's/^# (\w+)/.SH \1/g' \
|
||||
| sed -r 's/^##+ (\w+)/.SS \1/g' \
|
||||
| sed -r 's/^ (.*)$/\n\t\1\n/g' \
|
||||
| sed -r 's/^\t//g' \
|
||||
| sed -r 's/\$\{(\w+)\}/\\fB\$\1\\fR/g' \
|
||||
| sed -r 's/\{(\w+)\}/\\fI\1\\fR/g' \
|
||||
| sed -r 's/-----+//g' \
|
||||
| sed -r 's/`(.*?)`/\\fB\1\\fR/g' \
|
||||
| sed -r 's/MAPFILE/\\fImapfile\\fR/g' \
|
||||
| sed -r 's/\tttrts -/\tttrts \\-/g' >> $1
|
13
scripts/gen_version_header.sh
Executable file
13
scripts/gen_version_header.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
HEADER="// Auto generated ttrts version header
|
||||
// do not edit manually
|
||||
#ifndef _TTRTS_VERSION_H_
|
||||
#define _TTRTS_VERSION_H_
|
||||
|
||||
#define TTRTS_VERSION_MAJOR $1
|
||||
#define TTRTS_VERSION_MINOR $2
|
||||
#define TTRTS_VERSION_PATCH $3
|
||||
#define TTRTS_VERSION_STRING \"v$1.$2.$3\"
|
||||
|
||||
#endif //_TTRTS_VERSION_H_"
|
||||
|
||||
echo "$HEADER" > "version.h"
|
23
scripts/ttrts_complete
Executable file
23
scripts/ttrts_complete
Executable file
|
@ -0,0 +1,23 @@
|
|||
# ttrts completion
|
||||
|
||||
test ! -z TTRTS_MAPS && TTRTS_MAPS=/usr/share/ttrts/maps/
|
||||
|
||||
have ttrts &&
|
||||
function _ttrts
|
||||
{
|
||||
commandnames=""
|
||||
for filename in ${TTRTS_MAPS}/*
|
||||
do
|
||||
map="${filename##*/}"
|
||||
commandnames+="$map "
|
||||
done
|
||||
|
||||
local cur prev
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
COMPREPLY=( $(compgen -W "${commandnames}" -- ${cur}) )
|
||||
}
|
||||
|
||||
complete -F _ttrts ttrts
|
Loading…
Add table
Add a link
Reference in a new issue