cmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: MIT Imports: 7 Imported by: 0

README

Commands

Notes

TODO

  • how to avoid same function call for every subcommand, ie: Ayi git clone does not trigger Ayi git, in Ayi git I read git related config into memory, I don't want to call it in Ayi git clone since there will also be Ayi git sync, Ayi git rebase etc.
  • solution is https://github.com/spf13/cobra#prerun-or-postrun-hooks

Documentation

Overview

Package cmd defines and implements command-line commands and flags used by Ayi. Commands and flags are implemented using Cobra. it is generated by cobra https://github.com/spf13/cobra/tree/master/cobra and modified following https://github.com/spf13/hugo/blob/master/commands/hugo.go

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "Ayi",
	Short: "Ayi makes your life easier",
	Long:  `Ayi is a collection of small applications and tools that speed up your develop process`,
	Run: func(cmd *cobra.Command, args []string) {
		if version {
			versionCmd.Run(cmd, args)
			return
		}

		color.Green("Use 'Ayi help' to see all commands")
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

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