2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "argc";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.7.0";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigoden";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-B0oN5qYCShIsSvMFJB5EJPWOWM3Ubn8jl2gm+l5Wqg0=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-50ETDUKbK4oeVm9Ox44WVrAH5EAdH9F+sQk0WBTEQmY=";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-04-12 12:48:02 +00:00
|
|
|
installShellCompletion --cmd argc \
|
|
|
|
--bash <($out/bin/argc --argc-completions bash) \
|
|
|
|
--fish <($out/bin/argc --argc-completions fish) \
|
|
|
|
--zsh <($out/bin/argc --argc-completions zsh)
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-05-24 13:37:59 +00:00
|
|
|
description = "A command-line options, arguments and sub-commands parser for bash";
|
2022-09-30 11:47:45 +00:00
|
|
|
homepage = "https://github.com/sigoden/argc";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/sigoden/argc/releases/tag/v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|