Skip to content

Commit

Permalink
Fixed wording and spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
otm committed Mar 16, 2016
1 parent 29514b8 commit 3e43b0c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion assets/limes
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _limes()
fi
return
;;
--adress)
--address)
if [[ $(declare -f _filedir) ]]; then
_filedir
else
Expand Down
12 changes: 6 additions & 6 deletions cli-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand All @@ -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.
Expand All @@ -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())
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <serial>'\n", grpc.ErrorDesc(err))
return fmt.Sprintf("%v: run 'limes assume <profile>'\n", grpc.ErrorDesc(err))
case errUnknownProfile.Error():
return fmt.Sprintf("%v: run 'limes assume <profile>'\n", grpc.ErrorDesc(err))
}
Expand Down
28 changes: 14 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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], "")
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3e43b0c

Please sign in to comment.