commander-cli/cmd

View on GitHub
examples/working_dir.go

Summary

Maintainability
A
0 mins
Test Coverage
package examples

import "github.com/commander-cli/cmd"

// CreateWithWorkingDir sets the current working directory
func CreateWithWorkingDir() {
    setWorkingDir := func(c *cmd.Command) {
        c.WorkingDir = "/tmp"
    }
    c := cmd.NewCommand("pwd", cmd.WithStandardStreams, setWorkingDir)
    c.Execute()
}