mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -25,10 +25,6 @@ import (
|
|||||||
|
|
||||||
var _ cmder = (*benchmarkCmd)(nil)
|
var _ cmder = (*benchmarkCmd)(nil)
|
||||||
|
|
||||||
type cmder interface {
|
|
||||||
getCommand() *cobra.Command
|
|
||||||
}
|
|
||||||
|
|
||||||
type benchmarkCmd struct {
|
type benchmarkCmd struct {
|
||||||
benchmarkTimes int
|
benchmarkTimes int
|
||||||
cpuProfileFile string
|
cpuProfileFile string
|
||||||
@@ -37,6 +33,10 @@ type benchmarkCmd struct {
|
|||||||
cmd *cobra.Command
|
cmd *cobra.Command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type cmder interface {
|
||||||
|
getCommand() *cobra.Command
|
||||||
|
}
|
||||||
|
|
||||||
func (c *benchmarkCmd) getCommand() *cobra.Command {
|
func (c *benchmarkCmd) getCommand() *cobra.Command {
|
||||||
return c.cmd
|
return c.cmd
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,20 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
var checkCmd = &cobra.Command{
|
var _ cmder = (*checkCmd)(nil)
|
||||||
|
|
||||||
|
type checkCmd struct {
|
||||||
|
cmd *cobra.Command
|
||||||
|
}
|
||||||
|
|
||||||
|
func newCheckCmd() *checkCmd {
|
||||||
|
return &checkCmd{cmd: &cobra.Command{
|
||||||
Use: "check",
|
Use: "check",
|
||||||
Short: "Contains some verification checks",
|
Short: "Contains some verification checks",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *checkCmd) getCommand() *cobra.Command {
|
||||||
|
return c.cmd
|
||||||
}
|
}
|
||||||
|
@@ -197,7 +197,7 @@ func AddCommands() {
|
|||||||
HugoCmd.AddCommand(versionCmd)
|
HugoCmd.AddCommand(versionCmd)
|
||||||
HugoCmd.AddCommand(envCmd)
|
HugoCmd.AddCommand(envCmd)
|
||||||
HugoCmd.AddCommand(configCmd)
|
HugoCmd.AddCommand(configCmd)
|
||||||
HugoCmd.AddCommand(checkCmd)
|
HugoCmd.AddCommand(newCheckCmd().getCommand())
|
||||||
HugoCmd.AddCommand(newBenchmarkCmd().getCommand())
|
HugoCmd.AddCommand(newBenchmarkCmd().getCommand())
|
||||||
HugoCmd.AddCommand(convertCmd)
|
HugoCmd.AddCommand(convertCmd)
|
||||||
HugoCmd.AddCommand(newCmd)
|
HugoCmd.AddCommand(newCmd)
|
||||||
|
@@ -33,11 +33,14 @@ import (
|
|||||||
jww "github.com/spf13/jwalterweatherman"
|
jww "github.com/spf13/jwalterweatherman"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
var _ cmder = (*limitCmd)(nil)
|
||||||
checkCmd.AddCommand(limit)
|
|
||||||
|
type limitCmd struct {
|
||||||
|
cmd *cobra.Command
|
||||||
}
|
}
|
||||||
|
|
||||||
var limit = &cobra.Command{
|
func newLimitCmd() *limitCmd {
|
||||||
|
ccmd := &cobra.Command{
|
||||||
Use: "ulimit",
|
Use: "ulimit",
|
||||||
Short: "Check system ulimit settings",
|
Short: "Check system ulimit settings",
|
||||||
Long: `Hugo will inspect the current ulimit settings on the system.
|
Long: `Hugo will inspect the current ulimit settings on the system.
|
||||||
@@ -66,6 +69,18 @@ This is primarily to ensure that Hugo can watch enough files on some OSs`,
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return &limitCmd{cmd: ccmd}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *limitCmd) getCommand() *cobra.Command {
|
||||||
|
return c.cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// TODO(bep) cli refactor
|
||||||
|
//checkCmdOld.AddCommand(limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func tweakLimit() {
|
func tweakLimit() {
|
||||||
|
Reference in New Issue
Block a user