2022-09-30 11:47:45 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "argc";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "1.0.0";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigoden";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-lZtAhsEfMzj8Irl7LQPzjBNiKKy8091p2XoB5wSPhKM=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
cargoHash = "sha256-L0FX4RuJ5n76CCWVpGQryX7usXGBN55W9+y83s9JJug=";
|
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; {
|
|
|
|
description = "A tool to handle sh/bash cli parameters";
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|