mirror of
https://github.com/dvorka/hstr.git
synced 2024-09-20 14:56:14 +08:00
Debian: polishing various config files + DEB build script (blank license, changelog format, change line format issues remains).
This commit is contained in:
parent
271395d297
commit
faf0d935c4
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -2,4 +2,4 @@ hh (0.80-0ubuntu1) raring; urgency=low
|
|||
|
||||
* Fixed keyboard loop; Ctrl-r consistent shortcuts; propagation of the text from the prompt to HH.
|
||||
|
||||
-- Martin Dvorak (Dvorka) <martin.dvorak@mindforger.com> Wed, 25 Dec 2013 17:21:31 +0100
|
||||
-- Martin Dvorak <martin.dvorak@mindforger.com> Wed, 25 Dec 2013 17:21:31 +0100
|
||||
|
|
6
debian/control
vendored
6
debian/control
vendored
|
@ -1,14 +1,14 @@
|
|||
Source: hh
|
||||
Source: hstr
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Martin Dvorak (Dvorka) <martin.dvorak@mindforger.com>
|
||||
Maintainer: Martin Dvorak <martin.dvorak@mindforger.com>
|
||||
Build-Depends: debhelper (>= 8.0.0), autotools-dev, libreadline-dev, libncursesw5-dev
|
||||
Standards-Version: 3.9.5
|
||||
Homepage: https://github.com/dvorka/hstr
|
||||
Vcs-Git: https://github.com/dvorka/hstr.git
|
||||
Vcs-Browser: https://github.com/dvorka/hstr
|
||||
|
||||
Package: hh
|
||||
Package: hstr
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Suggest box like shell history completion
|
||||
|
|
4
debian/copyright
vendored
4
debian/copyright
vendored
|
@ -1,10 +1,10 @@
|
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: hh
|
||||
Upstream-Name: hstr
|
||||
Source: https://github.com/dvorka/hstr
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2015 Martin Dvorak <martin.dvorak@mindforger.com>
|
||||
License: Apache-2.0
|
||||
License: Apache
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
|
8
dist/2-debian-build-deb.sh
vendored
8
dist/2-debian-build-deb.sh
vendored
|
@ -7,7 +7,7 @@ export SCRIPTHOME=`pwd`
|
|||
function createChangelog() {
|
||||
export MYTS=`date "+%a, %d %b %Y %H:%M:%S"`
|
||||
echo "Changelog timestamp: ${MYTS}"
|
||||
echo -e "hh (${HHFULLVERSION}) ${UBUNTUVERSION}; urgency=low" > $1
|
||||
echo -e "hstr (${HHFULLVERSION}) ${UBUNTUVERSION}; urgency=low" > $1
|
||||
echo -e "\n" >> $1
|
||||
echo -e " * ${HHBZRMSG}" >> $1
|
||||
echo -e "\n" >> $1
|
||||
|
@ -26,18 +26,18 @@ function createTarball() {
|
|||
cd ../${HH}
|
||||
}
|
||||
|
||||
echo -e "\n_ hh deb build _______________________________________________\n"
|
||||
echo -e "\n_ HSTR deb build _______________________________________________\n"
|
||||
|
||||
rm -rvf ../debian
|
||||
cp -rvf ${HHSRC}/debian ..
|
||||
|
||||
createChangelog ../debian/changelog
|
||||
cp -vf debian/rules ../debian/rules
|
||||
cp -vf debian/hh.dirs ../debian/hh.dirs
|
||||
cp -vf debian/hstr.dirs ../debian/hstr.dirs
|
||||
cp -vf debian/watch ../debian/watch
|
||||
|
||||
cd ../..
|
||||
mv hh ${HH}
|
||||
mv hstr ${HH}
|
||||
cd ${HH}
|
||||
|
||||
createTarball
|
||||
|
|
2
dist/3-debian-push-mentors.sh
vendored
2
dist/3-debian-push-mentors.sh
vendored
|
@ -3,6 +3,6 @@
|
|||
. ./debian-env.sh
|
||||
|
||||
cd ../..
|
||||
dput mentors hh*source.changes
|
||||
dput mentors hstr*source.changes
|
||||
|
||||
# eof
|
||||
|
|
6
dist/debian-env.sh
vendored
6
dist/debian-env.sh
vendored
|
@ -2,10 +2,10 @@
|
|||
|
||||
# Debian release: https://wiki.debian.org/IntroDebianPackaging
|
||||
|
||||
export HHVERSION="1.0.8"
|
||||
export HHVERSION="1.17.0"
|
||||
#export HHFULLVERSION=${HHVERSION}-1.0 # NMU upload
|
||||
export HHFULLVERSION=${HHVERSION}-1 # mantainer upload
|
||||
export HH=hh_${HHVERSION}
|
||||
export HH=hstr_${HHVERSION}
|
||||
export HHRELEASE=hh-${HHFULLVERSION}
|
||||
export HHSRC=/home/dvorka/p/hstr/github/hstr
|
||||
export NOW=`date +%Y-%m-%d--%H-%M-%S`
|
||||
|
@ -13,6 +13,6 @@ export HHBUILD=hstr-${NOW}
|
|||
|
||||
export UBUNTUVERSION=unstable
|
||||
|
||||
export HHBZRMSG="Radix sort fixes."
|
||||
export HHBZRMSG="Debian distribution."
|
||||
|
||||
# eof
|
||||
|
|
6
dist/debian-make-distro.sh
vendored
6
dist/debian-make-distro.sh
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
. ~/p/hstr/github/hstr/dist/debian-env.sh
|
||||
|
||||
rm -rvf *.*~ ./debian
|
||||
rm -rvf *.*~ ./debian ./bin
|
||||
|
||||
mkdir ${HHBUILD}
|
||||
cd ${HHBUILD}
|
||||
|
@ -15,14 +15,14 @@ tar zcf ${HH}.tgz ${HH}
|
|||
rm -rvf ${HH}
|
||||
|
||||
#bzr dh-make -v packagename version tarball
|
||||
bzr dh_make -v hh ${HHVERSION} ${HH}.tgz
|
||||
bzr dh_make -v hstr ${HHVERSION} ${HH}.tgz
|
||||
|
||||
# rewrite to native dh_make:
|
||||
#dh_make --single --createorig
|
||||
|
||||
rm -vf *.orig.tar.gz
|
||||
|
||||
cd hh/dist
|
||||
cd hstr/dist
|
||||
./2-debian-build-deb.sh
|
||||
|
||||
pwd
|
||||
|
|
2
dist/debian/rules
vendored
2
dist/debian/rules
vendored
|
@ -3,4 +3,4 @@
|
|||
dh $@
|
||||
|
||||
override_dh_auto_install:
|
||||
$(MAKE) DESTDIR=$$(pwd)/debian/hh prefix=/usr install
|
||||
$(MAKE) DESTDIR=$$(pwd)/debian/hstr prefix=/usr install
|
||||
|
|
|
@ -1 +1 @@
|
|||
man_MANS = hh.1
|
||||
man_MANS = hh.1 hstr.1
|
||||
|
|
192
man/hstr.1
Normal file
192
man/hstr.1
Normal file
|
@ -0,0 +1,192 @@
|
|||
.TH HH 1
|
||||
.SH NAME
|
||||
\fBhh\fR \- easily view, navigate, sort and use your command history with shell history suggest box.
|
||||
.SH SYNOPSIS
|
||||
.B hh [option] [arg1] [arg2]...
|
||||
.SH DESCRIPTION
|
||||
.B hh
|
||||
uses shell history to provide suggest box like functionality
|
||||
for commands used in the past. By default it parses .bash-history
|
||||
file that is filtered as you type a command substring. Commands
|
||||
are not just filtered, but also ordered by a ranking algorithm
|
||||
that considers number of occurences, length and timestamp.
|
||||
Favorite and frequently used commands can be bookmarked. In addition
|
||||
\fBhh\fR allows removal of commands from history - for instance with a typo
|
||||
or with a sensitive content.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB-h --help\fR
|
||||
Show help
|
||||
.TP
|
||||
\fB-n --non-interactive\fR
|
||||
Print filtered history on standard output and exit
|
||||
.TP
|
||||
\fB-f --favorites\fR
|
||||
Show favorites view immediately
|
||||
.TP
|
||||
\fB-s --show-configuration\fR
|
||||
Show configuration that can be added to ~/.bashrc
|
||||
.TP
|
||||
\fB-b --show-blacklist\fR
|
||||
Show blacklist of commands to be filtered out before history processing
|
||||
.TP
|
||||
\fB-V --version\fR
|
||||
Show version information
|
||||
.SH KEYS
|
||||
.TP
|
||||
\fBpattern\fR
|
||||
Type to filter shell history.
|
||||
.TP
|
||||
\fBCtrl\-e\fR
|
||||
Toggle regular expression and substring search.
|
||||
.TP
|
||||
\fBCtrl\-t\fR
|
||||
Toggle case sensitive search.
|
||||
.TP
|
||||
\fBCtrl\-/\fR, \fBCtrl\-7\fR
|
||||
Rotate view of history as provided by Bash, ranked history ordered by the number of occurences/length/timestamp and favorites.
|
||||
.TP
|
||||
\fBCtrl\-f\fR
|
||||
Add currently selected command to favorites.
|
||||
.TP
|
||||
\fBCtrl\-l\fR
|
||||
Make search pattern lowercase or uppercase.
|
||||
.TP
|
||||
\fBCtrl\-r\fR, \fBUP\fR arrow, \fBDOWN\fR arrow, \fBCtrl\-n\fR, \fBCtrl\-p\fR
|
||||
Navigate in the history list.
|
||||
.TP
|
||||
\fBTAB\fR, \fBRIGHT\fR arrow
|
||||
Choose currently selected item for completion and let user to edit it on the command prompt.
|
||||
.TP
|
||||
\fBLEFT\fR arrow
|
||||
Choose currently selected item for completion and let user to edit it in editor (fix command).
|
||||
.TP
|
||||
\fBENTER\fR
|
||||
Choose currently selected item for completion and execute it.
|
||||
.TP
|
||||
\fBDEL\fR
|
||||
Remove currently selected item from the shell history.
|
||||
.TP
|
||||
\fBBACSKSPACE\fR, \fBCtrl\-h\fR
|
||||
Delete last pattern character.
|
||||
.TP
|
||||
\fBCtrl\-u\fR, \fBCtrl\-w\fR
|
||||
Delete pattern and search again.
|
||||
.TP
|
||||
\fBCtrl\-x\fR
|
||||
Write changes to shell history and exit.
|
||||
.TP
|
||||
\fBCtrl\-g\fR
|
||||
Exit with empty prompt.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
\fBhh\fR defines the following environment variables:
|
||||
.TP
|
||||
\fBHH_CONFIG\fR
|
||||
Configuration options:
|
||||
|
||||
\fIhicolor\fR
|
||||
Get more colors with this option (default is monochromatic).
|
||||
|
||||
\fImonochromatic\fR
|
||||
Ensure black and white view.
|
||||
|
||||
\fIregexp\fR
|
||||
Filter command history using regular expressions (substring match is default)
|
||||
|
||||
\fIsubstring\fR
|
||||
Filter command history using substring.
|
||||
|
||||
\fIkeywords\fR
|
||||
Filter command history using keywords - item matches if contains all keywords in pattern in any order.
|
||||
|
||||
\fIcasesensitive\fR
|
||||
Make history filtering case sensitive (it's case insensitive by default).
|
||||
|
||||
\fIrawhistory\fR
|
||||
Show normal history as a default view (metric-based view is shown otherwise).
|
||||
|
||||
\fIfavorites\fR
|
||||
Show favorites as a default view (metric-based view is shown otherwise).
|
||||
|
||||
\fIblacklist\fR
|
||||
Load list of commands to skip when processing history from ~/.hh_blacklist (built-in blacklist used otherwise).
|
||||
|
||||
\fIbigkeysskip\fR
|
||||
Skip big history entries i.e. very long lines (default).
|
||||
|
||||
\fIbigkeysfloor\fR
|
||||
Use different sorting slot for big keys when building metrics-based view (big keys are skipped by default).
|
||||
|
||||
\fIbigkeysexit\fR
|
||||
Exit (fail) on presence of a big key in history (big keys are skipped by default).
|
||||
|
||||
\fIwarning\fR
|
||||
Show warning.
|
||||
|
||||
\fIdebug\fR
|
||||
Show debug information.
|
||||
|
||||
Example:
|
||||
\fBexport HH_CONFIG=hicolor,regexp,rawhistory\fR
|
||||
|
||||
.TP
|
||||
\fBHH_PROMPT\fR
|
||||
Change prompt string which is \fBuser@host$\fR by default.
|
||||
|
||||
Example:
|
||||
\fBexport HH_PROMPT="$ "\fR
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
\fB~/.hh_favorites\fR
|
||||
Bookmarked favorite commands.
|
||||
.TP
|
||||
\fB~/.hh_blacklist\fR
|
||||
Command blacklist.
|
||||
|
||||
.SH BASH CONFIGURATION
|
||||
Optionally add the following lines to ~/.bashrc:
|
||||
.nf
|
||||
.sp
|
||||
export HH_CONFIG=hicolor # get more colors
|
||||
shopt -s histappend # append new history items to .bash_history
|
||||
export HISTCONTROL=ignorespace # leading space hides commands from history
|
||||
export HISTFILESIZE=10000 # increase history file size (default is 500)
|
||||
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
|
||||
export PROMPT_COMMAND="history \-a; history \-n; ${PROMPT_COMMAND}"
|
||||
# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)
|
||||
if [[ $\- =~ .*i.* ]]; then bind '"\eC\-r": "\eC\-a hh \eC-j"'; fi
|
||||
.sp
|
||||
.fi
|
||||
The prompt command ensures synchronization of the history between BASH memory
|
||||
and history file.
|
||||
.SH ZSH CONFIGURATION
|
||||
Optionally add the following lines to ~/.zshrc:
|
||||
.nf
|
||||
.sp
|
||||
export HISTFILE=~/.zsh_history # ensure history file visibility
|
||||
export HH_CONFIG=hicolor # get more colors
|
||||
bindkey -s "\eC\-r" "\eeqhh\en" # bind hh to Ctrl-r (for Vi mode check doc)
|
||||
.sp
|
||||
.fi
|
||||
.SH EXAMPLES
|
||||
.TP
|
||||
\fBhh git\fR
|
||||
Start `hh` and show only history items containing 'git'.
|
||||
.TP
|
||||
\fBhh --non-interactive git\fR
|
||||
Print history items containing 'git' to standard output and exit.
|
||||
.TP
|
||||
\fBhh --show-configuration >> ~/.bashrc\fR
|
||||
Append default \fBhh\fR configuration to your Bash profile.
|
||||
.TP
|
||||
\fBhh --show-blacklist\fR
|
||||
Show blacklist configured for history processing.
|
||||
.SH AUTHOR
|
||||
Written by Martin Dvorak <martin.dvorak@mindforger.com>
|
||||
.SH BUGS
|
||||
Report bugs to https://github.com/dvorka/hstr/issues
|
||||
.SH "SEE ALSO"
|
||||
.BR history (1),
|
||||
.BR bash (1),
|
||||
.BR zsh (1)
|
|
@ -31,3 +31,7 @@ hh_SOURCES = \
|
|||
hstr_regexp.c include/hstr_regexp.h \
|
||||
radixsort.c include/radixsort.h \
|
||||
hstr.c
|
||||
|
||||
# create hh > hstr hard link on installation
|
||||
install-exec-hook:
|
||||
ln $(DESTDIR)$(bindir)/hh$(EXEEXT) $(DESTDIR)$(bindir)/hstr$(EXEEXT)
|
||||
|
|
Loading…
Reference in a new issue