Skip to content

Commit

Permalink
refactor: docgen subcommand rename and description
Browse files Browse the repository at this point in the history
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
  • Loading branch information
f0rmiga committed Jan 13, 2022
1 parent 24ef379 commit 7f690ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cmd/docgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ func main() {

aspectRootCmd := root.NewDefaultRootCmd(pluginSystem)

cmd.AddCommand(NewCommandListCmd(aspectRootCmd))
cmd.AddCommand(NewBzlCommandListCmd(aspectRootCmd))
cmd.AddCommand(NewGenMarkdownCmd(aspectRootCmd))

if err := cmd.Execute(); err != nil {
log.Fatal(err)
}
}

func NewCommandListCmd(aspectRootCmd *cobra.Command) *cobra.Command {
func NewBzlCommandListCmd(aspectRootCmd *cobra.Command) *cobra.Command {
cmd := &cobra.Command{
Use: "command-list",
Short: "Creates a .bzl file with the top-level list of commands of the aspect CLI.",
Use: "bzl-command-list",
Short: "Prints a .bzl file with the top-level list of commands of the aspect CLI.",
Long: "This command is used to produce the .bzl file with the list of top-level commands" +
"used to automatically generate markdown documentation for this repository.",
RunE: func(_ *cobra.Command, _ []string) (exitErr error) {
fmt.Println(`"""Generated file - do NOT edit!`)
fmt.Println("This module contains the list of top-level commands from the aspect CLI.")
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _DOCS = ["aspect.md"] + [
genrule(
name = "command_list_bzl",
outs = ["command_list.bzl"],
cmd = "$(execpath //cmd/docgen) command-list > $@",
cmd = "$(execpath //cmd/docgen) bzl-command-list > $@",
tools = ["//cmd/docgen"],
)

Expand Down

0 comments on commit 7f690ce

Please sign in to comment.