1{ lib
2, rustPlatform
3, fetchFromGitHub
4, installShellFiles
5}:
6
7rustPlatform.buildRustPackage rec {
8 pname = "argc";
9 version = "1.12.0";
10
11 src = fetchFromGitHub {
12 owner = "sigoden";
13 repo = pname;
14 rev = "v${version}";
15 hash = "sha256-bF+NTiPrqWD1B/v44+XuxXotOPhUBCYyg6h+T/ydmGM=";
16 };
17
18 cargoHash = "sha256-T6NfjlHQhHwfcAnmr8R2WWXVKgMZZXFq6IvlvWOVACg=";
19
20 nativeBuildInputs = [ installShellFiles ];
21
22 postInstall = ''
23 installShellCompletion --cmd argc \
24 --bash <($out/bin/argc --argc-completions bash) \
25 --fish <($out/bin/argc --argc-completions fish) \
26 --zsh <($out/bin/argc --argc-completions zsh)
27 '';
28
29 meta = with lib; {
30 description = "A command-line options, arguments and sub-commands parser for bash";
31 homepage = "https://github.com/sigoden/argc";
32 changelog = "https://github.com/sigoden/argc/releases/tag/v${version}";
33 license = with licenses; [ mit /* or */ asl20 ];
34 maintainers = with maintainers; [ figsoda ];
35 };
36}