xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
Commit 9ad1b946c1bb524201901d8b7b45d8e325f1f6c9

Adding autoconf/automate configuration files.
Author: Martin Dvorak
Author date (UTC): 2013-12-25 14:25
Committer name: Martin Dvorak
Committer date (UTC): 2013-12-25 14:25
Parent(s): f94df24dd183f25f0a6377c404055cf7bd5e06e1
Signing key:
Tree: 0a8187a61dad72f9aaf379c8300dc2f39c50a8ee
File Lines added Lines deleted
Makefile.am 3 0
bin/clean.sh 10 0
bin/dist.sh 11 0
bin/man.sh 5 0
configure.ac 47 0
man/Makefile.am 1 0
man/hh.1 46 0
src/Makefile.am 13 0
File Makefile.am added (mode: 100644) (index 0000000..fa824bc)
1 # hh make
2 AUTOMAKE_OPTIONS = foreign
3 SUBDIRS = src man
File bin/clean.sh added (mode: 100755) (index 0000000..7273d94)
1 #!/bin/bash
2
3 rm -vf *.*~ ../*.*~ ../src/*.*~
4 rm -rvf ../atom5te.cache
5 rm -vf ../man/Makefile ../man/Makefile.in
6 rm -vf ../src/Makefile ../src/Makefile.in ../src/hh ../src/*.o
7 rm -rvf ../src/.deps
8 rm -vf ../Makefile ../Makefile.in ../aclocal.m4 ../config.log ../config.status ../configure ../depcomp ../install-sh ../missing
9
10 # eof
File bin/dist.sh added (mode: 100755) (index 0000000..b0babd8)
1 #!/bin/bash
2
3 ./clean.sh
4
5 cd ..
6 aclocal
7 automake --add-missing
8 autoconf
9 cd bin
10
11 # eof
File bin/man.sh added (mode: 100755) (index 0000000..a60dfa5)
1 #!/bin/bash
2
3 cd ../man && groff -man -Tascii hh.1
4
5 # eof
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/Makefile.am added (mode: 100644) (index 0000000..e8316cc)
1 man_MANS = hh.1
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
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master