Browse Source

update doc generation (#926)

blotus 3 years ago
parent
commit
2f937cb53a
3 changed files with 11 additions and 9 deletions
  1. 4 3
      cmd/crowdsec-cli/alerts.go
  2. 4 3
      cmd/crowdsec-cli/console.go
  3. 3 3
      cmd/crowdsec-cli/main.go

+ 4 - 3
cmd/crowdsec-cli/alerts.go

@@ -199,9 +199,10 @@ func DisplayOneAlert(alert *models.Alert, withDetail bool) error {
 func NewAlertsCmd() *cobra.Command {
 	/* ---- ALERTS COMMAND */
 	var cmdAlerts = &cobra.Command{
-		Use:   "alerts [action]",
-		Short: "Manage alerts",
-		Args:  cobra.MinimumNArgs(1),
+		Use:               "alerts [action]",
+		Short:             "Manage alerts",
+		Args:              cobra.MinimumNArgs(1),
+		DisableAutoGenTag: true,
 		PersistentPreRun: func(cmd *cobra.Command, args []string) {
 			var err error
 			if err := csConfig.LoadAPIClient(); err != nil {

+ 4 - 3
cmd/crowdsec-cli/console.go

@@ -15,9 +15,10 @@ import (
 
 func NewConsoleCmd() *cobra.Command {
 	var cmdConsole = &cobra.Command{
-		Use:   "console [action]",
-		Short: "Manage interaction with Crowdsec console (https://app.crowdsec.net)",
-		Args:  cobra.MinimumNArgs(1),
+		Use:               "console [action]",
+		Short:             "Manage interaction with Crowdsec console (https://app.crowdsec.net)",
+		Args:              cobra.MinimumNArgs(1),
+		DisableAutoGenTag: true,
 		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
 			if err := csConfig.LoadAPIServer(); err != nil || csConfig.DisableAPI {
 				log.Fatal("Local API is disabled, please run this command on the local API machine")

+ 3 - 3
cmd/crowdsec-cli/main.go

@@ -100,8 +100,7 @@ title: %s
 }
 
 func linkHandler(name string) string {
-	base := strings.TrimSuffix(name, path.Ext(name))
-	return fmt.Sprintf("/docs/cscli/%s", base)
+	return fmt.Sprintf("/cscli/%s", name)
 }
 
 func main() {
@@ -111,7 +110,8 @@ func main() {
 		Short: "cscli allows you to manage crowdsec",
 		Long: `cscli is the main command to interact with your crowdsec service, scenarios & db.
 It is meant to allow you to manage bans, parsers/scenarios/etc, api and generally manage you crowdsec setup.`,
-		ValidArgs: validArgs,
+		ValidArgs:         validArgs,
+		DisableAutoGenTag: true,
 		/*TBD examples*/
 	}
 	var cmdDocGen = &cobra.Command{