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-08-04 22:07:22 +00:00
|
|
|
version = "1.8.0";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigoden";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-xuSoTTtULVdG1LZFiEPYYuwJxG7FdN9vY+7K7OmfWZI=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cargoHash = "sha256-BJaVaOBCLH5c7/DrsOq6uVN02wEfLA7k+FgxCBmOUTA=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|