pkill: updated to procps-ng 4.0.5

This commit is contained in:
Saurabh Kushwah 2025-04-19 23:38:47 +05:30
parent 6d847d3c76
commit 147cbd2ba2
No known key found for this signature in database
GPG Key ID: 8E11E1DCD6CCE8D5

View File

@ -2,6 +2,7 @@ package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/env"
"github.com/carapace-sh/carapace-bin/pkg/actions/os"
"github.com/carapace-sh/carapace-bin/pkg/actions/ps"
"github.com/spf13/cobra"
@ -10,32 +11,39 @@ import (
var rootCmd = &cobra.Command{
Use: "pkill",
Short: "look up for processes based on name and other attributes",
Long: "https://linux.die.net/man/1/pkill",
Long: "https://man7.org/linux/man-pages/man1/pgrep.1.html",
Run: func(cmd *cobra.Command, args []string) {},
}
func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()
rootCmd.Flags().String("cgroup", "", "match by cgroup v2 names")
rootCmd.Flags().BoolP("count", "c", false, "count of matching processes")
rootCmd.Flags().BoolP("echo", "e", false, "display what is killed")
rootCmd.Flags().String("env", "", "match on environment variable")
rootCmd.Flags().StringP("euid", "u", "", "match by effective IDs")
rootCmd.Flags().BoolP("exact", "x", false, "match exactly with the command name")
rootCmd.Flags().BoolP("full", "f", false, "use full process name to match")
rootCmd.Flags().StringP("group", "G", "", "match real group IDs")
rootCmd.Flags().BoolP("help", "h", false, "display this help and exit")
rootCmd.Flags().BoolP("ignore-ancestors", "A", false, "exclude our ancestors from results")
rootCmd.Flags().BoolP("ignore-case", "i", false, "match case insensitively")
rootCmd.Flags().BoolP("logpidfile", "L", false, "fail if PID file is not locked")
rootCmd.Flags().BoolP("newest", "n", false, "select most recently started")
rootCmd.Flags().String("ns", "", "match the processes that belong to the same namespace as <pid>")
rootCmd.Flags().String("nslist", "", "list which namespaces will be considered for the --ns option.")
rootCmd.Flags().StringP("older", "O", "", "select where older than seconds")
rootCmd.Flags().BoolP("oldest", "o", false, "select least recently started")
rootCmd.Flags().StringP("parent", "P", "", "match only child processes of the given parent")
rootCmd.Flags().StringP("pgroup", "g", "", "match listed process group IDs")
rootCmd.Flags().StringP("pidfile", "F", "", "read PIDs from file")
rootCmd.Flags().StringP("queue", "q", "", "integer value to be sent with the signal")
rootCmd.Flags().BoolP("require-handler", "H", false, "match only if signal handler is present")
rootCmd.Flags().StringP("runstates", "r", "", "match runstates [D,S,Z,...]")
rootCmd.Flags().StringP("session", "s", "", "match session IDs")
rootCmd.Flags().String("signal", "", "signal to send (either number or name)")
@ -44,6 +52,7 @@ func init() {
rootCmd.Flags().BoolP("version", "V", false, "output version information and exit")
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"env": env.ActionNameValues(false).UniqueList(","),
"euid": os.ActionUsers(),
"group": os.ActionGroups(),
"nslist": carapace.ActionValues("ipc", "mnt", "net", "pid", "user", "uts").UniqueList(","),