man

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

man pages for akita cli commands.

Since go's raw string literals do not allow backticks, we use <bt> instead and replaces it to backticks on render.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:          "man [COMMAND]",
	Short:        "Manual pages for Akita commands.",
	SilenceUsage: true,
	Args:         cobra.MaximumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		command := ""
		if len(args) > 0 {
			command = args[0]
		}

		if rawFlag || command != "" {
			var targetPage *page
			for _, p := range allPages {
				if p.command == command {
					targetPage = &p
					break
				}
			}

			if targetPage == nil {
				return errors.Errorf("unknown command %q", command)
			} else if rawFlag {
				fmt.Println(targetPage.content)
				return nil
			}
		}

		if err := showInteractive(command); err != nil {
			return cmderr.AkitaErr{Err: err}
		}
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL