2021-04-18 02:13:31 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "with";
|
|
|
|
version = "unstable-2018-03-20";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mchav";
|
|
|
|
repo = "With";
|
2021-04-18 02:13:31 +00:00
|
|
|
rev = "28eb40bbc08d171daabf0210f420477ad75e16d6";
|
|
|
|
hash = "sha256-mKHsLHs9/I+NUdb1t9wZWkPxXcsBlVWSj8fgZckXFXk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-04-18 02:13:31 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2021-04-18 02:13:31 +00:00
|
|
|
runHook preInstall
|
|
|
|
install -D with $out/bin/with
|
|
|
|
installShellCompletion --bash --name with.bash with.bash-completion
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-04-18 02:13:31 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/mchav/With";
|
|
|
|
description = "Command prefixing for continuous workflow using a single tool";
|
2021-04-18 02:13:31 +00:00
|
|
|
longDescription = ''
|
|
|
|
with is a Bash script that starts an interactive shell with where every
|
|
|
|
command is prefixed using <program>.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
$ with git
|
|
|
|
git> add .
|
2022-12-28 21:21:41 +00:00
|
|
|
git> commit -a -m "Committed"
|
2021-04-18 02:13:31 +00:00
|
|
|
git> push
|
|
|
|
|
|
|
|
Can also be used for compound commands.
|
|
|
|
|
|
|
|
$ with java Primes
|
|
|
|
java Primes> 1
|
|
|
|
2
|
|
|
|
java Primes> 4
|
|
|
|
7
|
|
|
|
|
|
|
|
And to repeat commands:
|
|
|
|
|
|
|
|
$ with gcc -o output input.c
|
|
|
|
gcc -o -output input.c>
|
|
|
|
<enter>
|
|
|
|
Compiling...
|
|
|
|
gcc -o -output input.c>
|
|
|
|
|
|
|
|
To execute a shell command proper prefix line with :.
|
|
|
|
|
|
|
|
git> :ls
|
|
|
|
|
|
|
|
You can also drop, add, and replace different commands.
|
|
|
|
|
|
|
|
git> +add
|
|
|
|
git add> <some file>
|
|
|
|
git add> !commit
|
|
|
|
git commit> <arguments and message>
|
|
|
|
git commit> -
|
|
|
|
git>
|
|
|
|
|
|
|
|
To exit use either :q or :exit.
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|