// Generates and returns a markdown-formatted CLI reference page for Odo
Generates and returns a markdown-formatted CLI reference page for Odo
// Generates and returns a markdown - formatted CLI reference page for Odo
func main() {
	var clidoc = &cobra.Command{
		Use:   "cli-doc",
		Short: "Generate CLI reference for Odo",
		Example: `  # Generate a markdown-formatted CLI reference page for Odo
  cli-doc reference > docs/cli-reference.md
  # Generate the CLI structure
  cli-doc structure`,
		Args:      cobra.OnlyValidArgs,
		ValidArgs: []string{"help", "reference", "structure"},
		Run: func(command *cobra.Command, args []string) {
			if len(args) == 0 {
				fmt.Print(command.Usage())
			} else {
				switch args[0] {
				case "reference":
					fmt.Print(referencePrinter(cli.NewCmdOdo(cli.OdoRecommendedName, cli.OdoRecommendedName), 0))
				case "structure":
					fmt.Print(commandPrinter(cli.NewCmdOdo(cli.OdoRecommendedName, cli.OdoRecommendedName), 0))
				default:
					fmt.Print(command.Usage())
				}
			}
		},
	}
	err := clidoc.Execute()
	if err != nil {
		fmt.Println(errors.Cause(err))
		os.Exit(1)
	}
}
func main ( ) { var clidoc = & cobra . Command { Use : " " , Short : " " , Example : `  # Generate a markdown-formatted CLI reference page for Odo
  cli-doc reference > docs/cli-reference.md

  # Generate the CLI structure
  cli-doc structure` , Args : cobra . OnlyValidArgs , ValidArgs : [ ] string { " " , " " , " " } , Run : func ( command * cobra . Command , args [ ] string ) { if len ( args ) == 0 { fmt . Print ( command . Usage ( ) ) } else { switch args [ 0 ] { case " " : fmt . Print ( referencePrinter ( cli . NewCmdOdo ( cli . OdoRecommendedName , cli . OdoRecommendedName ) , 0 ) ) case " " : fmt . Print ( commandPrinter ( cli . NewCmdOdo ( cli . OdoRecommendedName , cli . OdoRecommendedName ) , 0 ) ) default : fmt . Print ( command . Usage ( ) ) } } } , } err := clidoc . Execute ( ) if err != nil { fmt . Println ( errors . Cause ( err ) ) os . Exit ( 1 ) } }
Generates and returns a markdown-formatted CLI reference page for Odo
Generates and returns a markdown - formatted CLI reference page for Odo