Skip to content

Commit

Permalink
Terminal prompt inject to insert; build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka committed Dec 3, 2021
1 parent 1a36278 commit 41a2989
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2021-12-03 Martin Dvorak <[email protected]>

* 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 <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 7 additions & 6 deletions build/ubuntu/launchpad-make-all-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion build/ubuntu/pbuilder-add-new-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions build/ubuntu/pbuilder-refresh-all-distros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions man/hstr.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <[email protected]>
Expand Down
22 changes: 11 additions & 11 deletions src/hstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down

0 comments on commit 41a2989

Please sign in to comment.