Merge pull request #2963 from znz/fix-typos

Fix typos
This commit is contained in:
Jose Diaz-Gonzalez
2017-11-03 11:26:55 -04:00
committed by GitHub
6 changed files with 12 additions and 12 deletions

View File

@@ -87,7 +87,7 @@ func (e *Env) Get(key string) (value string, ok bool) {
return return
} }
//GetDefault an environment variable or a default if it doesnt exist //GetDefault an environment variable or a default if it doesn't exist
func (e *Env) GetDefault(key string, defaultValue string) string { func (e *Env) GetDefault(key string, defaultValue string) string {
v, ok := e.env[key] v, ok := e.env[key]
if !ok { if !ok {
@@ -126,12 +126,12 @@ func (e *Env) Keys() (keys []string) {
return return
} }
//Len return the number of items in this environment //Len returns the number of items in this environment
func (e *Env) Len() int { func (e *Env) Len() int {
return len(e.env) return len(e.env)
} }
//Map return the Env as a map //Map returns the Env as a map
func (e *Env) Map() map[string]string { func (e *Env) Map() map[string]string {
return e.env return e.env
} }
@@ -140,7 +140,7 @@ func (e *Env) String() string {
return e.EnvfileString() return e.EnvfileString()
} }
//Merge merges the given environment on top of the reciever //Merge merges the given environment on top of the receiver
func (e *Env) Merge(other *Env) { func (e *Env) Merge(other *Env) {
for _, k := range other.Keys() { for _, k := range other.Keys() {
e.Set(k, other.GetDefault(k, "")) e.Set(k, other.GetDefault(k, ""))
@@ -196,7 +196,7 @@ func (e *Env) ShellString() string {
return e.stringWithPrefixAndSeparator("", " ") return e.stringWithPrefixAndSeparator("", " ")
} }
//ExportBundle writes a tarfile of the environmnet to the given io.Writer. //ExportBundle writes a tarfile of the environment to the given io.Writer.
// for every environment variable there is a file with the variable's key // for every environment variable there is a file with the variable's key
// with its content set to the variable's value // with its content set to the variable's value
func (e *Env) ExportBundle(dest io.Writer) error { func (e *Env) ExportBundle(dest io.Writer) error {
@@ -231,7 +231,7 @@ func (e *Env) stringWithPrefixAndSeparator(prefix string, separator string) stri
} }
//singleQuoteEscape escapes the value as if it were shell-quoted in single quotes //singleQuoteEscape escapes the value as if it were shell-quoted in single quotes
func singleQuoteEscape(value string) string { // so that 'esc'apped' -> 'esc'\''aped' func singleQuoteEscape(value string) string { // so that 'esc'aped' -> 'esc'\''aped'
return strings.Replace(value, "'", "'\\''", -1) return strings.Replace(value, "'", "'\\''", -1)
} }

View File

@@ -25,7 +25,7 @@ config_export() {
config_keys() { config_keys() {
declare desc="returns keys for app or global" declare desc="returns keys for app or global"
config_keys "$@" config_sub keys "$@"
return 0 return 0
} }
@@ -40,7 +40,7 @@ config_set() {
} }
config_unset() { config_unset() {
declare desc="set value of given config var" declare desc="unset value of given config var"
config_sub unset "$@" config_sub unset "$@"
} }

View File

@@ -8,7 +8,7 @@ import (
) )
func main() { func main() {
args := flag.NewFlagSet("config:get", flag.ExitOnError) args := flag.NewFlagSet("config:bundle", flag.ExitOnError)
global := args.Bool("global", false, "--global: use the global environment") global := args.Bool("global", false, "--global: use the global environment")
merged := args.Bool("merged", false, "--merged: merge app environment and global environment") merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
args.Parse(os.Args[2:]) args.Parse(os.Args[2:])

View File

@@ -8,7 +8,7 @@ import (
) )
func main() { func main() {
args := flag.NewFlagSet("config:get", flag.ExitOnError) args := flag.NewFlagSet("config:keys", flag.ExitOnError)
global := args.Bool("global", false, "--global: use the global environment") global := args.Bool("global", false, "--global: use the global environment")
merged := args.Bool("merged", false, "--merged: merge app environment and global environment") merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
args.Parse(os.Args[2:]) args.Parse(os.Args[2:])

View File

@@ -7,7 +7,7 @@ import (
"github.com/dokku/dokku/plugins/config" "github.com/dokku/dokku/plugins/config"
) )
// set the given entries from the specified environment // set the given entries to the specified environment
func main() { func main() {
args := flag.NewFlagSet("config:set", flag.ExitOnError) args := flag.NewFlagSet("config:set", flag.ExitOnError)
global := args.Bool("global", false, "--global: use the global environment") global := args.Bool("global", false, "--global: use the global environment")

View File

@@ -9,7 +9,7 @@ import (
"github.com/dokku/dokku/plugins/common" "github.com/dokku/dokku/plugins/common"
) )
//CommandShow implementes config:show //CommandShow implements config:show
func CommandShow(args []string, global bool, shell bool, export bool, merged bool) { func CommandShow(args []string, global bool, shell bool, export bool, merged bool) {
appName, _ := getCommonArgs(global, args) appName, _ := getCommonArgs(global, args)
env := getEnvironment(appName, merged) env := getEnvironment(appName, merged)