depot/third_party/nixpkgs/pkgs/development/tools/argc/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

32 lines
963 B
Nix

{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "argc";
version = "1.0.0";
src = fetchFromGitHub {
owner = "sigoden";
repo = pname;
rev = "v${version}";
hash = "sha256-lZtAhsEfMzj8Irl7LQPzjBNiKKy8091p2XoB5wSPhKM=";
};
cargoHash = "sha256-L0FX4RuJ5n76CCWVpGQryX7usXGBN55W9+y83s9JJug=";
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 tool to handle sh/bash cli parameters";
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 ];
};
}