artisan: complete, horizonpurge, serve

This commit is contained in:
rsteube 2024-07-28 19:51:36 +02:00
parent 9478978b41
commit 588b9ef471
3 changed files with 15 additions and 0 deletions

View File

@ -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"),
})
}

View File

@ -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"
)
@ -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(),
})
}

View File

@ -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"
)
@ -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(),
})
}