From af2b2fe34a5cadd8907ebd348789bccddaf3e9de Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Fri, 16 Apr 2021 22:55:32 -0300 Subject: [PATCH] with-shell: 2016-08-20 -> 2018-03-20 --- pkgs/applications/misc/with-shell/default.nix | 76 ++++++++++++++++--- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/with-shell/default.nix b/pkgs/applications/misc/with-shell/default.nix index daf697c16614..cf52d194f617 100644 --- a/pkgs/applications/misc/with-shell/default.nix +++ b/pkgs/applications/misc/with-shell/default.nix @@ -1,20 +1,76 @@ -{ lib, stdenv, fetchFromGitHub }: -stdenv.mkDerivation { - name = "with-2016-08-20"; +{ lib +, stdenv +, fetchFromGitHub +, installShellFiles +}: + +stdenv.mkDerivation rec { + pname = "with"; + version = "unstable-2018-03-20"; + src = fetchFromGitHub { owner = "mchav"; repo = "With"; - rev = "cc2828bddd92297147d4365765f4ef36385f050a"; - sha256 = "10m2xv6icrdp6lfprw3a9hsrzb3bip19ipkbmscap0niddqgcl9b"; + rev = "28eb40bbc08d171daabf0210f420477ad75e16d6"; + hash = "sha256-mKHsLHs9/I+NUdb1t9wZWkPxXcsBlVWSj8fgZckXFXk="; }; + + nativeBuildInputs = [ installShellFiles ]; + installPhase = '' - mkdir -p $out/bin - cp with $out/bin/with + runHook preInstall + install -D with $out/bin/with + installShellCompletion --bash --name with.bash with.bash-completion + runHook postInstall ''; - meta = { + + meta = with lib; { homepage = "https://github.com/mchav/With"; description = "Command prefixing for continuous workflow using a single tool"; - license = lib.licenses.asl20; - platforms = lib.platforms.unix; + longDescription = '' + with is a Bash script that starts an interactive shell with where every + command is prefixed using . + + For example: + + $ with git + git> add . + git> commit -a -m "Commited" + 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> + + 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> + git add> !commit + git commit> + git commit> - + git> + + To exit use either :q or :exit. + ''; + license = licenses.asl20; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = platforms.unix; }; }