Add completions to package
This commit is contained in:
parent
7db2b9f030
commit
d185802c65
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
result
|
||||
.direnv
|
@ -68,6 +68,13 @@
|
||||
pname = "natstonotify";
|
||||
src = src;
|
||||
vendorHash = "sha256-xAFxgUH2QUkmdCXJB4NzURozedgMIyawdf/g3vxOyC0=";
|
||||
nativeBuildInputs = [ pkgs.installShellFiles ];
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd natstonotify \
|
||||
--bash <($out/bin/natstonotify completion bash) \
|
||||
--zsh <($out/bin/natstonotify completion zsh) \
|
||||
--fish <($out/bin/natstonotify completion fish)
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
@ -78,6 +85,7 @@
|
||||
packages = with pkgs; [
|
||||
go
|
||||
golangci-lint
|
||||
(self.packages.${pkgs.system}.default)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
2
main.go
2
main.go
@ -62,6 +62,7 @@ func main() {
|
||||
{
|
||||
Name: "server",
|
||||
Usage: "Start the server",
|
||||
EnableShellCompletion: true,
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
b, err := bus.NewNotifyBus()
|
||||
if err != nil {
|
||||
@ -109,6 +110,7 @@ func main() {
|
||||
Aliases: []string{"n"},
|
||||
Usage: "Send a notification",
|
||||
ArgsUsage: "SUMMARY [BODY]",
|
||||
EnableShellCompletion: true,
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "local",
|
||||
|
Loading…
x
Reference in New Issue
Block a user