mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-05 23:42:54 +00:00
Added nproc completer
This commit is contained in:
parent
2f19f2f611
commit
f85c93da69
26
completers/nproc_completer/cmd/root.go
Normal file
26
completers/nproc_completer/cmd/root.go
Normal 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")
|
||||||
|
}
|
7
completers/nproc_completer/main.go
Normal file
7
completers/nproc_completer/main.go
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "github.com/carapace-sh/carapace-bin/completers/nproc_completer/cmd"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
cmd.Execute()
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user