depot/third_party/nixpkgs/pkgs/development/tools/argc/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

36 lines
994 B
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "argc";
version = "1.10.0";
src = fetchFromGitHub {
owner = "sigoden";
repo = pname;
rev = "v${version}";
hash = "sha256-DmBSHiil9TdPog1Tnz2UjwbgLwwJwdYg9qAykolriQs=";
};
cargoHash = "sha256-JyiBEawBTm8t9oKFH5OCKabWasuiRoBe0rSeyHKuXGU=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd argc \
--bash <($out/bin/argc --argc-completions bash) \
--fish <($out/bin/argc --argc-completions fish) \
--zsh <($out/bin/argc --argc-completions zsh)
'';
meta = with lib; {
description = "A command-line options, arguments and sub-commands parser for bash";
homepage = "https://github.com/sigoden/argc";
changelog = "https://github.com/sigoden/argc/releases/tag/v${version}";
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ figsoda ];
};
}