Documentation ¶
Index ¶
- Constants
- func ArgExactN(n int) func(c int) error
- func ArgMaxN(n int) func(c int) error
- func ArgMinN(n int) func(c int) error
- func ArgNone() func(c int) error
- func ArgRangeNM(n int, m int) func(c int) error
- func ErrorWrappedEvaluateContext() (models.NestContext, error)
- func GetApplicationMutex() (internal.LockFile, error)
- func GetProjectRootFromCwd() (models.Path, error)
- func PrintUsage(cmd *cobra.Command, args []string) error
- func RunWrapper(run func(cmd *cobra.Command, args []string) error, ...) func(cmd *cobra.Command, args []string) error
Constants ¶
const NoNestedModulesMsg = "no nested modules defined in current context"
Variables ¶
This section is empty.
Functions ¶
func ErrorWrappedEvaluateContext ¶
func ErrorWrappedEvaluateContext() (models.NestContext, error)
ErrorWrappedEvaluateContext is a wrapper for the cmd package to remove repetitive boilerplate code. It returns the evaluated context or a preformatted error.
func GetApplicationMutex ¶ added in v0.0.2
GetApplicationMutex is a wrapper function to get a git-nest lockfile at the project root directory.
func GetProjectRootFromCwd ¶ added in v0.0.2
GetProjectRootFromCwd returns the project root directory, starting from the current directory.
func PrintUsage ¶
PrintUsage is a wrapper function around the default cobra.Command Usage() function.
func RunWrapper ¶
func RunWrapper(run func(cmd *cobra.Command, args []string) error, validateArgCount ...func(c int) error) func(cmd *cobra.Command, args []string) error
RunWrapper wraps the function set for the 'Run' field in a cobra.Command. It takes a runner function and an argument count validation function. If the latter is not nil, it is executed first and checked for returned errors. If no errors were returned, the runner function is executed.
Types ¶
This section is empty.