Skip to content

Commit

Permalink
artisan: complete, horizonpurge, serve
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jul 28, 2024
1 parent 9478978 commit 588b9ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions completers/artisan_completer/cmd/complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ func init() {
completeCmd.Flags().String("shell", "", "The shell type (\"bash\", \"fish\", \"zsh\")")
completeCmd.Flags().String("symfony", "", "deprecated")
rootCmd.AddCommand(completeCmd)

carapace.Gen(completeCmd).FlagCompletion(carapace.ActionMap{
"shell": carapace.ActionValues("bash", "fish", "zsh"),
})
}
5 changes: 5 additions & 0 deletions completers/artisan_completer/cmd/horizonPurge.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/ps"
"github.com/spf13/cobra"
)

Expand All @@ -16,4 +17,8 @@ func init() {

horizonPurgeCmd.Flags().String("signal", "", "The signal to send to the rogue processes")
rootCmd.AddCommand(horizonPurgeCmd)

carapace.Gen(horizonPurgeCmd).FlagCompletion(carapace.ActionMap{
"signal": ps.ActionKillSignals(),
})
}
6 changes: 6 additions & 0 deletions completers/artisan_completer/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra"
)

Expand All @@ -19,4 +20,9 @@ func init() {
serveCmd.Flags().String("port", "", "The port to serve the application on")
serveCmd.Flags().String("tries", "", "The max number of ports to attempt to serve from")
rootCmd.AddCommand(serveCmd)

carapace.Gen(serveCmd).FlagCompletion(carapace.ActionMap{
"host": carapace.ActionValues("localhost", "127.0.0.1"),
"port": net.ActionPorts(),
})
}

0 comments on commit 588b9ef

Please sign in to comment.