commands

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package commands define command-line interface for Hoor, current implementation is based on the Cobra package.

Index

Constants

This section is empty.

Variables

View Source
var HoorCmd = &cobra.Command{
	Use:   "hoor",
	Short: "Add Shamsi date to Hugo based websites with ease",
	Run: func(cmd *cobra.Command, args []string) {
		startTime = time.Now()

		if debugMode {
			jww.SetStdoutThreshold(jww.LevelTrace)
		}

		if err := defineWorkingDir(); err != nil {
			return
		}

		if err := hugolib.LoadGlobalConfig(sourcePath, cfgFile); err != nil {
			jww.ERROR.Println("Cannot find configurations file")
			jww.DEBUG.Println(err)
			return
		}

		site, err := loadHugoSite()
		if err != nil {
			return
		}

		if input != "" {
			applyToFile(input)
			return
		}

		applyToSite(site)
	},
}

HoorCmd represents the base command when called without any subcommands.

Functions

func Setup

func Setup()

Setup adds all child commands to the root command and sets flags appropriately.

Types

This section is empty.

Jump to

Keyboard shortcuts

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