1{ lib
2, stdenv
3, fetchFromGitHub
4, installShellFiles
5}:
6
7stdenv.mkDerivation rec {
8 pname = "with";
9 version = "unstable-2018-03-20";
10
11 src = fetchFromGitHub {
12 owner = "mchav";
13 repo = "With";
14 rev = "28eb40bbc08d171daabf0210f420477ad75e16d6";
15 hash = "sha256-mKHsLHs9/I+NUdb1t9wZWkPxXcsBlVWSj8fgZckXFXk=";
16 };
17
18 nativeBuildInputs = [ installShellFiles ];
19
20 installPhase = ''
21 runHook preInstall
22 install -D with $out/bin/with
23 installShellCompletion --bash --name with.bash with.bash-completion
24 runHook postInstall
25 '';
26
27 meta = with lib; {
28 homepage = "https://github.com/mchav/With";
29 description = "Command prefixing for continuous workflow using a single tool";
30 longDescription = ''
31 with is a Bash script that starts an interactive shell with where every
32 command is prefixed using <program>.
33
34 For example:
35
36 $ with git
37 git> add .
38 git> commit -a -m "Committed"
39 git> push
40
41 Can also be used for compound commands.
42
43 $ with java Primes
44 java Primes> 1
45 2
46 java Primes> 4
47 7
48
49 And to repeat commands:
50
51 $ with gcc -o output input.c
52 gcc -o -output input.c>
53 <enter>
54 Compiling...
55 gcc -o -output input.c>
56
57 To execute a shell command proper prefix line with :.
58
59 git> :ls
60
61 You can also drop, add, and replace different commands.
62
63 git> +add
64 git add> <some file>
65 git add> !commit
66 git commit> <arguments and message>
67 git commit> -
68 git>
69
70 To exit use either :q or :exit.
71 '';
72 license = licenses.asl20;
73 maintainers = with maintainers; [ AndersonTorres ];
74 platforms = platforms.unix;
75 };
76}