File configure.ac added (mode: 100644) (index 0000000..7e34ba6) |
|
1 |
|
# -*- Autoconf -*- |
|
2 |
|
# Process this file with autoconf to produce a configure script. |
|
3 |
|
# |
|
4 |
|
|
|
5 |
|
AC_PREREQ([2.69]) |
|
6 |
|
|
|
7 |
|
AC_INIT(hh, 0.7, martin.dvorak@mindforger.com) |
|
8 |
|
AM_INIT_AUTOMAKE(hh, 0.7) |
|
9 |
|
AC_OUTPUT(Makefile src/Makefile man/Makefile) |
|
10 |
|
|
|
11 |
|
# Checks for src dir existence. |
|
12 |
|
AC_CONFIG_SRCDIR([src/hstr.c]) |
|
13 |
|
# Where to generate header file. |
|
14 |
|
#AC_CONFIG_HEADERS([config.h]) |
|
15 |
|
|
|
16 |
|
# Checks for programs. |
|
17 |
|
AC_PROG_CC |
|
18 |
|
|
|
19 |
|
# Checks for libraries. |
|
20 |
|
AC_CHECK_LIB(ncurses, initscr) |
|
21 |
|
AC_CHECK_LIB(m,cos) |
|
22 |
|
AC_CHECK_LIB(readline, using_history) |
|
23 |
|
|
|
24 |
|
# Checks for header files. |
|
25 |
|
AC_CHECK_HEADER(assert.h) |
|
26 |
|
AC_CHECK_HEADER(curses.h) |
|
27 |
|
AC_CHECK_HEADER(fcntl.h) |
|
28 |
|
AC_CHECK_HEADER(math.h) |
|
29 |
|
AC_CHECK_HEADER(readline/history.h) |
|
30 |
|
AC_CHECK_HEADER(stdbool.h) |
|
31 |
|
AC_CHECK_HEADER(stddef.h) |
|
32 |
|
AC_CHECK_HEADER(stdio.h) |
|
33 |
|
AC_CHECK_HEADER(stdlib.h) |
|
34 |
|
AC_CHECK_HEADER(string.h) |
|
35 |
|
AC_CHECK_HEADER(sys/ioctl.h) |
|
36 |
|
AC_CHECK_HEADER(termios.h) |
|
37 |
|
AC_CHECK_HEADER(unistd.h) |
|
38 |
|
|
|
39 |
|
# Checks for typedefs, structures, and compiler characteristics. |
|
40 |
|
AC_CHECK_HEADER_STDBOOL |
|
41 |
|
AC_TYPE_SIZE_T |
|
42 |
|
|
|
43 |
|
# Checks for library functions. |
|
44 |
|
AC_FUNC_MALLOC |
|
45 |
|
AC_CHECK_FUNCS([memset strdup strstr]) |
|
46 |
|
|
|
47 |
|
AC_OUTPUT |
File man/hh.1 added (mode: 100644) (index 0000000..48dc705) |
|
1 |
|
.TH HH 1 |
|
2 |
|
.SH NAME |
|
3 |
|
\fBhh\fR \- suggest commands from shell history |
|
4 |
|
.SH SYNOPSIS |
|
5 |
|
.B hh |
|
6 |
|
.SH DESCRIPTION |
|
7 |
|
.B hh |
|
8 |
|
uses shell history to provide suggest box like functionality |
|
9 |
|
for commands used in the past. By default it parses .bash-history |
|
10 |
|
file that is filtered as you type a command substring. Commands |
|
11 |
|
are not just filtered, but also ordered by a ranking algorithm |
|
12 |
|
that considers number of occurences, length and timestamp. In addition |
|
13 |
|
hh allows removal of commands from history - for instance with a typo or with a sensitive content. |
|
14 |
|
.SH COMMANDS |
|
15 |
|
.TP |
|
16 |
|
\fBpattern\fR |
|
17 |
|
Type to filter shell history. |
|
18 |
|
.TP |
|
19 |
|
\fBUP\fR arrow, \fBDOWN\fR arrow |
|
20 |
|
Navigate in the history list. |
|
21 |
|
.TP |
|
22 |
|
\fBENTER\fR |
|
23 |
|
Choose currently selected item for completion. |
|
24 |
|
.TP |
|
25 |
|
\fBCtrl\-r\fR |
|
26 |
|
Remove currently selected item from the shell history. |
|
27 |
|
.TP |
|
28 |
|
\fBCtrl\-x\fR |
|
29 |
|
Write changes to shell history and exit. |
|
30 |
|
.SH INSTALLATION |
|
31 |
|
Add the following lines to ~/.bashrc: |
|
32 |
|
.nf |
|
33 |
|
.sp |
|
34 |
|
shopt -s histappend |
|
35 |
|
export PROMPT_COMMAND="history \-a; history \-n; ${PROMPT_COMMAND}" |
|
36 |
|
bind '"\eC\-r": "\eC\-k\eC\-uhh\eC-j"' |
|
37 |
|
.sp |
|
38 |
|
.fi |
|
39 |
|
.SH AUTHOR |
|
40 |
|
Written by Martin Dvorak <martin.dvorak@mindforger.com> |
|
41 |
|
.SH BUGS |
|
42 |
|
Report bugs to https://github.com/dvorka/hstr/issues |
|
43 |
|
.SH "SEE ALSO" |
|
44 |
|
.BR history (1), |
|
45 |
|
.BR bash (1) |
|
46 |
|
|
File src/Makefile.am added (mode: 100644) (index 0000000..84eaf53) |
|
1 |
|
# http://mij.oltrelinux.com/devel/autoconf-automake/ |
|
2 |
|
AM_CFLAGS = --pedantic -Wall -std=c99 -O2 |
|
3 |
|
AM_LDFLAGS = -lncurses -lreadline -lm |
|
4 |
|
|
|
5 |
|
# bin_ installs to bin; hh_ is the binary name |
|
6 |
|
bin_PROGRAMS = hh |
|
7 |
|
|
|
8 |
|
hh_SOURCES = \ |
|
9 |
|
hashset.c include/hashset.h \ |
|
10 |
|
radixsort.c include/radixsort.h \ |
|
11 |
|
hstr_history.c include/hstr_history.h \ |
|
12 |
|
hstr_utils.c include/hstr_utils.h \ |
|
13 |
|
hstr.c |