From 41a2989e7f1035d59d703128e7dc1a903aaa2242 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Fri, 3 Dec 2021 18:45:59 +0100 Subject: [PATCH] Terminal prompt inject to insert; build fixes. --- Changelog | 2 +- README.md | 1 + build/ubuntu/launchpad-make-all-releases.sh | 13 ++++++------ build/ubuntu/pbuilder-add-new-distro.sh | 2 +- build/ubuntu/pbuilder-refresh-all-distros.sh | 6 ++++-- man/hstr.1 | 6 +++--- src/hstr.c | 22 ++++++++++---------- 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Changelog b/Changelog index da3a5d2d..21d390f3 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,6 @@ 2021-12-03 Martin Dvorak - * Released v2.4.0 - ability to inject custom command to terminal prompt, + * Released v2.4.0 - ability to insert custom command to terminal prompt, minor fixes. 2020-11-19 Martin Dvorak diff --git a/README.md b/README.md index 6e3d6a1c..b62691c8 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ Tarball: * [build and install tarball](INSTALLATION.md#build-and-install-tarball) +Check also [packages](https://pkgs.org/search/?q=hstr) for Linux and Unix. ## Configuration Configure HSTR just by running: diff --git a/build/ubuntu/launchpad-make-all-releases.sh b/build/ubuntu/launchpad-make-all-releases.sh index 5b161aa0..9d845c3c 100755 --- a/build/ubuntu/launchpad-make-all-releases.sh +++ b/build/ubuntu/launchpad-make-all-releases.sh @@ -163,14 +163,15 @@ then exit 1 fi -export ARG_BAZAAR_MSG="Release 2.3" -export ARG_MAJOR_VERSION=2.3. -export ARG_MINOR_VERSION=0 # minor version is incremented for every Ubuntu version +export ARG_BAZAAR_MSG="Release 2.4" +export ARG_MAJOR_VERSION=2.4. +export ARG_MINOR_VERSION=7 # minor version is incremented for every Ubuntu version # https://wiki.ubuntu.com/Releases -# old: precise quantal saucy precise utopic vivid wily yakkety artful cosmic -# current: trusty xenial bionic focal groovy hirsute -for UBUNTU_VERSION in trusty xenial bionic focal groovy hirsute +# obsolete: precise quantal saucy precise utopic vivid wily yakkety artful cosmic +# current : (trusty) xenial bionic (cosmic disco eoan) focal (groovy) hirsute impish +# xenial bionic focal hirsute impish +for UBUNTU_VERSION in trusty xenial bionic focal hirsute impish do echo "Releasing HSTR for Ubuntu version: ${UBUNTU_VERSION}" releaseForParticularUbuntuVersion ${UBUNTU_VERSION} ${ARG_MAJOR_VERSION}${ARG_MINOR_VERSION} "${ARG_BAZAAR_MSG}" diff --git a/build/ubuntu/pbuilder-add-new-distro.sh b/build/ubuntu/pbuilder-add-new-distro.sh index e0d475eb..6086fad6 100755 --- a/build/ubuntu/pbuilder-add-new-distro.sh +++ b/build/ubuntu/pbuilder-add-new-distro.sh @@ -17,7 +17,7 @@ # https://wiki.ubuntu.com/Releases # boostrap new OR refresh distribution base for pbuilder -export DISTRO=hirsute +export DISTRO=impish sudo pbuilder --create $DISTRO rm -vf ~/pbuilder/${DISTRO}-base.tgz diff --git a/build/ubuntu/pbuilder-refresh-all-distros.sh b/build/ubuntu/pbuilder-refresh-all-distros.sh index 3d726383..eec86239 100755 --- a/build/ubuntu/pbuilder-refresh-all-distros.sh +++ b/build/ubuntu/pbuilder-refresh-all-distros.sh @@ -14,8 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -# old distros: precise quantal saucy utopic -for DISTRO in trusty xenial bionic disco eoan +# https://wiki.ubuntu.com/Releases +# obsolete: precise quantal saucy precise utopic vivid wily yakkety artful cosmic +# current : (trusty) xenial bionic (cosmic disco eoan) focal (groovy) hirsute impish +for DISTRO in xenial bionic focal hirsute impish do sudo pbuilder --create ${DISTRO} diff --git a/man/hstr.1 b/man/hstr.1 index 62718b49..5b448e23 100644 --- a/man/hstr.1 +++ b/man/hstr.1 @@ -24,8 +24,8 @@ Print filtered history on standard output and exit \fB-k --kill-last-command\fR Delete the last command from history and exit .TP -\fB-i --inject-in-terminal=[command]\fR -Inject custom command to terminal prompt and exit +\fB-i --insert-in-terminal=[command]\fR +Insert custom command to terminal prompt and exit .TP \fB-f --favorites\fR Show favorites view immediately @@ -225,7 +225,7 @@ bindkey -s "\eC\-r" "\eC\-a hstr \-\- \eC\-j" # bind hstr to Ctrl-r (for Vi mode \fBhstr --show-blacklist\fR Show blacklist configured for history processing. .TP -\fBhstr --inject-in-terminal="git add . && git diff --cached"\fR +\fBhstr --insert-in-terminal="git add . && git diff --cached"\fR Insert command in terminal prompt and exit. .SH AUTHOR Written by Martin Dvorak diff --git a/src/hstr.c b/src/hstr.c index 1cbbc313..a1dfc2e6 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -263,7 +263,7 @@ static const char* HELP_STRING= "\n --show-configuration -s ... show configuration to be added to ~/.bashrc" "\n --show-zsh-configuration -z ... show zsh configuration to be added to ~/.zshrc" "\n --show-blacklist -b ... show commands to skip on history indexation" - "\n --inject-in-terminal=[c] -i ... inject command c in terminal prompt and exit" + "\n --insert-in-terminal=[c] -i ... insert command c in terminal prompt and exit" "\n --version -V ... show version details" "\n --help -h ... help" "\n" @@ -280,16 +280,16 @@ static const char* LABEL_HELP= #define GETOPT_OPTIONAL_ARGUMENT 2 static const struct option long_options[] = { - {"favorites", GETOPT_NO_ARGUMENT, NULL, 'f'}, - {"kill-last-command", GETOPT_NO_ARGUMENT, NULL, 'k'}, - {"version", GETOPT_NO_ARGUMENT, NULL, 'V'}, - {"help", GETOPT_NO_ARGUMENT, NULL, 'h'}, - {"non-interactive", GETOPT_NO_ARGUMENT, NULL, 'n'}, - {"show-configuration", GETOPT_NO_ARGUMENT, NULL, 's'}, - {"show-zsh-configuration", GETOPT_NO_ARGUMENT, NULL, 'z'}, - {"show-blacklist", GETOPT_NO_ARGUMENT, NULL, 'b'}, - {"inject-in-terminal", GETOPT_OPTIONAL_ARGUMENT, NULL, 'i'}, - {0, 0, NULL, 0 } + {"favorites", GETOPT_NO_ARGUMENT, NULL, 'f'}, + {"kill-last-command", GETOPT_NO_ARGUMENT, NULL, 'k'}, + {"version", GETOPT_NO_ARGUMENT, NULL, 'V'}, + {"help", GETOPT_NO_ARGUMENT, NULL, 'h'}, + {"non-interactive", GETOPT_NO_ARGUMENT, NULL, 'n'}, + {"show-configuration", GETOPT_NO_ARGUMENT, NULL, 's'}, + {"show-zsh-configuration", GETOPT_NO_ARGUMENT, NULL, 'z'}, + {"show-blacklist", GETOPT_NO_ARGUMENT, NULL, 'b'}, + {"insert-in-terminal", GETOPT_REQUIRED_ARGUMENT, NULL, 'i'}, + {0, 0, NULL, 0 } }; typedef struct {