package cmds
import "os"
// chDir: changes the current working directory
// if no directory is specifed sets it to home
func ChDir(args []string) error {
var dir string
if len(args) == 1 {
dir, _ = os.UserHomeDir()
} else {
dir = args[1]
}
return os.Chdir(dir)
}