depot/third_party/nixpkgs/pkgs/development/tools/argc/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

36 lines
993 B
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "argc";
version = "1.8.0";
src = fetchFromGitHub {
owner = "sigoden";
repo = pname;
rev = "v${version}";
hash = "sha256-xuSoTTtULVdG1LZFiEPYYuwJxG7FdN9vY+7K7OmfWZI=";
};
cargoHash = "sha256-BJaVaOBCLH5c7/DrsOq6uVN02wEfLA7k+FgxCBmOUTA=";
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 ];
};
}