diff --git a/Makefile.am b/Makefile.am index fa824bc..5fbb269 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,2 @@ -# hh make AUTOMAKE_OPTIONS = foreign SUBDIRS = src man \ No newline at end of file diff --git a/README.md b/README.md index 1300859..afa1a75 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,16 @@ DOWNLOAD https://github.com/dvorka/hstr/releases +BUILD +------------ +* install from the source distribution: + + `./configure && make && make install` + + INSTALLATION ------------ -* add `hh` to `$PATH` +* make sure `hh` is in `${PATH}` * add `shopt -s histappend` @@ -33,18 +40,13 @@ INSTALLATION `bind '"\C-r": "\C-k\C-uhh\C-j"'` - or F12: - - `bind '"\e[24~":"\C-k\C-uhh\C-j"'` - or Ctrl-F12: `bind '"\e[24;5~":"\C-k\C-uhh\C-j"'` To determine the character sequence emitted by a pressed key in terminal, - type CTRL-v and then press the key. For example, F12 gives `^[[24~`. - Replace the `^[` with `\e`. To clear the line first, add `\C-k \C-u` in - front of the actual command. Check your current bindings using: + type CTRL-v and then press the key. To clear the line first, add `\C-k \C-u` + in front of the actual command. Check your current bindings using: `bind -S` diff --git a/bin/clean.sh b/bin/clean.sh index 7273d94..3002dfa 100755 --- a/bin/clean.sh +++ b/bin/clean.sh @@ -1,5 +1,7 @@ #!/bin/bash +rm -vrf ../.git ../.settings ../Debug ../Release ../.cproject ../.project ../.gitignore + rm -vf *.*~ ../*.*~ ../src/*.*~ rm -rvf ../atom5te.cache rm -vf ../man/Makefile ../man/Makefile.in diff --git a/bin/deb.sh b/bin/deb.sh new file mode 100755 index 0000000..5aa5df0 --- /dev/null +++ b/bin/deb.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# copy hstr/ source code to a work directory and run this script to create DEB package +mv -vf ../debian ../.. +./dist.sh +cd ../.. +mv hstr hh-0.7 +tar zcf hh-0.7.tgz hh-0.7 +bzr dh-make hh 0.7 hh-0.7.tgz +cd hh +rm -rvf debian +cp -vrf ../debian . +bzr commit -m "Initial commit of Debian packaging." +bzr builddeb -- -us -uc + +bzr builddeb -S && cd ../build-area && pbuilder-dist raring build hh_0.7-0ubuntu1.dsc + +# eof diff --git a/bin/dist.sh b/bin/dist.sh index b0babd8..101b926 100755 --- a/bin/dist.sh +++ b/bin/dist.sh @@ -4,8 +4,14 @@ cd .. aclocal -automake --add-missing +automake --force-missing --add-missing autoconf + +rm -vf depcomp install-sh missing +cp -vf /usr/share/automake-1.11/depcomp . +cp -vf /usr/share/automake-1.11/install-sh . +cp -vf /usr/share/automake-1.11/missing . + cd bin # eof \ No newline at end of file diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..529c1d2 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +hh (0.7-0ubuntu1) raring; urgency=low + + * Initial release. + + -- Martin Dvorak (Dvorka) Wed, 25 Dec 2013 17:21:31 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8c0d281 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: hh +Section: admin +Priority: extra +Maintainer: Martin Dvorak +Build-Depends: debhelper (>= 8.0.0), autotools-dev +Standards-Version: 3.9.4 +Homepage: https://github.com/dvorka/hstr +Vcs-Git: https://github.com/dvorka/hstr.git +Vcs-Browser: https://github.com/dvorka/hstr + +Package: hh +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libreadline5 +Description: Suggest box like shell history completion + A command line utility that brings improved shell command completion + from the history. It aims to make completion easier and faster than Ctrl-R. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cb72e41 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,18 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: hh +Source: https://github.com/dvorka/hstr + +Files: debian/* +Copyright: 2013 Martin Dvorak +License: Apache-2.0 + 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 + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..312e24d --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ --with autotools-dev diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/src/Makefile.am b/src/Makefile.am index 84eaf53..594f9e6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ # http://mij.oltrelinux.com/devel/autoconf-automake/ AM_CFLAGS = --pedantic -Wall -std=c99 -O2 -AM_LDFLAGS = -lncurses -lreadline -lm +AM_LDFLAGS = # bin_ installs to bin; hh_ is the binary name bin_PROGRAMS = hh diff --git a/src/hstr.c b/src/hstr.c index f8c2a43..7d685a8 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -249,7 +249,7 @@ char *selection_loop(HistoryItems *history) { int selectionCursorPosition=SELECTION_CURSOR_IN_PROMPT; int previousSelectionCursorPosition=SELECTION_CURSOR_IN_PROMPT; - int y = 1, c, maxHistoryItems, cursorX, cursorY, deleteOccurences; + int y = 1, c, maxHistoryItems, cursorX=0, cursorY=0, deleteOccurences; bool done = FALSE; char prefix[SELECTION_PREFIX_MAX_LNG]=""; char *result="", *msg, *delete;