Added nproc completer

This commit is contained in:
Saurabh Kushwah 2025-05-02 13:20:02 +05:30
parent 2f19f2f611
commit f85c93da69
No known key found for this signature in database
GPG Key ID: 8E11E1DCD6CCE8D5
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "nproc",
Short: "print the number of processing units available",
Long: "https://www.man7.org/linux/man-pages/man1/nproc.1.html",
Run: func(cmd *cobra.Command, args []string) {},
}
func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()
rootCmd.Flags().Bool("all", false, "print the number of installed processors")
rootCmd.Flags().Bool("help", false, "display this help and exit")
rootCmd.Flags().String("ignore", "", "if possible, exclude N processing units")
rootCmd.Flags().Bool("version", false, "output version information and exit")
}

View File

@ -0,0 +1,7 @@
package main
import "github.com/carapace-sh/carapace-bin/completers/nproc_completer/cmd"
func main() {
cmd.Execute()
}