From 3e43b0c9e1e411b0b88086a3bce96722a626417f Mon Sep 17 00:00:00 2001 From: Nils Lagerkvist Date: Wed, 16 Mar 2016 20:03:36 +0100 Subject: [PATCH] Fixed wording and spelling --- assets/limes | 2 +- cli-client.go | 12 ++++++------ main.go | 28 ++++++++++++++-------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/assets/limes b/assets/limes index 6115dba..7190ca2 100644 --- a/assets/limes +++ b/assets/limes @@ -34,7 +34,7 @@ _limes() fi return ;; - --adress) + --address) if [[ $(declare -f _filedir) ]]; then _filedir else diff --git a/cli-client.go b/cli-client.go index 5f689c0..ad07cc4 100644 --- a/cli-client.go +++ b/cli-client.go @@ -47,7 +47,7 @@ func newCliClient(address string) *cliClient { } // StartService bootstraps the metadata service -func StartService(configFile, adress, profileName, MFA string, port int, fake bool) { +func StartService(configFile, address, profileName, MFA string, port int, fake bool) { log := &ConsoleLogger{} config := Config{} @@ -69,8 +69,8 @@ func StartService(configFile, adress, profileName, MFA string, port int, fake bo } defer func() { - log.Debug("Removing socket: %v\n", adress) - os.Remove(adress) + log.Debug("Removing socket: %v\n", address) + os.Remove(address) }() // Startup the HTTP server and respond to requests. @@ -97,7 +97,7 @@ func StartService(configFile, adress, profileName, MFA string, port int, fake bo mds.Start() stop := make(chan struct{}) - agentServer := NewCliHandler(adress, credsManager, stop, config) + agentServer := NewCliHandler(address, credsManager, stop, config) err = agentServer.Start() if err != nil { log.Fatalf("Failed to start agentServer: %s\n", err.Error()) @@ -179,7 +179,7 @@ func (c *cliClient) status(args *Status) error { } else { fmt.Fprintf(out, "Status: %v\n", "ok") } - fmt.Fprintf(out, "Role: %v\n", r.Role) + fmt.Fprintf(out, "Profile: %v\n", r.Role) if args.Verbose == false { return err @@ -271,7 +271,7 @@ func lookupCorrection(err error) string { case codes.FailedPrecondition: switch grpc.ErrorDesc(err) { case errMFANeeded.Error(): - return fmt.Sprintf("%v: run 'limes credentials --mfa '\n", grpc.ErrorDesc(err)) + return fmt.Sprintf("%v: run 'limes assume '\n", grpc.ErrorDesc(err)) case errUnknownProfile.Error(): return fmt.Sprintf("%v: run 'limes assume '\n", grpc.ErrorDesc(err)) } diff --git a/main.go b/main.go index f7e5210..033318e 100644 --- a/main.go +++ b/main.go @@ -58,7 +58,7 @@ type Limes struct { Fix Fix `command:"fix" description:"Fix configuration"` Profile string `option:"profile" default:"" description:"Profile to assume"` ConfigFile string `option:"c, config" default:"" description:"Configuration file"` - Adress string `option:"adress" default:"" description:"Address to connect to"` + Address string `option:"address" default:"" description:"Address to connect to"` Logging bool `flag:"verbose" description:"Enable verbose output"` } @@ -123,7 +123,7 @@ func (l *Start) Run(cmd *Limes, p writ.Path, positional []string) { if cmd.Profile == "" { cmd.Profile = "default" } - StartService(cmd.ConfigFile, cmd.Adress, cmd.Profile, l.MFA, l.Port, l.Fake) + StartService(cmd.ConfigFile, cmd.Address, cmd.Profile, l.MFA, l.Port, l.Fake) } // Run is the handler for the stop command @@ -132,7 +132,7 @@ func (l *Stop) Run(cmd *Limes, p writ.Path, positional []string) { p.Last().ExitHelp(nil) } - rpc := newCliClient(cmd.Adress) + rpc := newCliClient(cmd.Address) defer rpc.close() rpc.stop(l) } @@ -143,7 +143,7 @@ func (l *Status) Run(cmd *Limes, p writ.Path, positional []string) { p.Last().ExitHelp(nil) } - rpc := newCliClient(cmd.Adress) + rpc := newCliClient(cmd.Address) defer rpc.close() rpc.status(l) } @@ -231,7 +231,7 @@ func (l *SwitchProfile) Run(cmd *Limes, p writ.Path, positional []string) { p.Last().ExitHelp(errors.New("profile name is required")) } - rpc := newCliClient(cmd.Adress) + rpc := newCliClient(cmd.Address) defer rpc.close() rpc.assumeRole(positional[0], "") } @@ -245,7 +245,7 @@ func (l *RunCmd) Run(cmd *Limes, p writ.Path, positional []string) { command := exec.Command(positional[0], positional[1:]...) if cmd.Profile != "" { - rpc := newCliClient(cmd.Adress) + rpc := newCliClient(cmd.Address) defer rpc.close() creds, err := rpc.retreiveRole(cmd.Profile, "") if err != nil { @@ -283,7 +283,7 @@ func (l *ShowCmd) Run(cmd *Limes, p writ.Path, positional []string) { switch positional[0] { case "profiles": - rpc := newCliClient(cmd.Adress) + rpc := newCliClient(cmd.Address) defer rpc.close() roles, err := rpc.listRoles() if err != nil { @@ -315,17 +315,17 @@ func (l *Env) Run(cmd *Limes, p writ.Path, positional []string) { p.Last().ExitHelp(nil) } - rpc := newCliClient(cmd.Adress) + rpc := newCliClient(cmd.Address) defer rpc.close() creds, err := rpc.retreiveRole(profile, "") if err != nil { - fmt.Fprintf(errout, "error retreiving role: %v\n", err) + fmt.Fprintf(errout, "error retreiving profile: %v\n", err) os.Exit(1) } credentials, err := creds.Get() if err != nil { - fmt.Fprintf(errout, "error unpacking role: %v", err) + fmt.Fprintf(errout, "error unpacking profile: %v", err) os.Exit(1) } fmt.Fprintf(out, "export AWS_ACCESS_KEY_ID=%v\n", credentials.AccessKeyID) @@ -335,9 +335,9 @@ func (l *Env) Run(cmd *Limes, p writ.Path, positional []string) { fmt.Fprintf(out, "# eval \"$(limes env %s)\"\n", profile) } -func setDefaultSocketAdress(adress string) string { - if adress != "" { - return adress +func setDefaultSocketAddress(address string) string { + if address != "" { + return address } home, err := homeDir() @@ -397,7 +397,7 @@ func main() { } } - limes.Adress = setDefaultSocketAdress(limes.Adress) + limes.Address = setDefaultSocketAddress(limes.Address) limes.ConfigFile = setDefaultConfigPath(limes.ConfigFile) if !limes.Logging { log.SetOutput(ioutil.Discard)