-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
doc.go
41 lines (36 loc) · 1.98 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/rustup_completer/cmd/action"
"github.com/spf13/cobra"
)
var docCmd = &cobra.Command{
Use: "doc",
Short: "Open the documentation for the current toolchain",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(docCmd).Standalone()
docCmd.Flags().Bool("alloc", false, "The Rust core allocation and collections library")
docCmd.Flags().Bool("book", false, "The Rust Programming Language book")
docCmd.Flags().Bool("cargo", false, "The Cargo Book")
docCmd.Flags().Bool("core", false, "The Rust Core Library")
docCmd.Flags().Bool("edition-guide", false, "The Rust Edition Guide")
docCmd.Flags().Bool("embedded-book", false, "The Embedded Rust Book")
docCmd.Flags().BoolP("help", "h", false, "Prints help information")
docCmd.Flags().Bool("nomicon", false, "The Dark Arts of Advanced and Unsafe Rust Programming")
docCmd.Flags().Bool("path", false, "Only print the path to the documentation")
docCmd.Flags().Bool("proc_macro", false, "A support library for macro authors when defining new macros")
docCmd.Flags().Bool("reference", false, "The Rust Reference")
docCmd.Flags().Bool("rust-by-example", false, "A collection of runnable examples that illustrate various Rust concepts and standard")
docCmd.Flags().Bool("rustc", false, "The compiler for the Rust programming language")
docCmd.Flags().Bool("rustdoc", false, "Generate documentation for Rust projects")
docCmd.Flags().Bool("std", false, "Standard library API documentation")
docCmd.Flags().Bool("test", false, "Support code for rustc's built in unit-test and micro-benchmarking framework")
docCmd.Flags().String("toolchain", "", "Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see")
docCmd.Flags().Bool("unstable-book", false, "The Unstable Book")
rootCmd.AddCommand(docCmd)
carapace.Gen(docCmd).FlagCompletion(carapace.ActionMap{
"toolchain": action.ActionToolchains(),
})
}