Kiln » gitkiln Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

add logout command, and do not require logging in

At the moment, there aren't any commands that require logging in, so
it's silly to require the user to store their credentials. Change
the main loop to assume authentication is NOT required. A subsequent
commit will restore that functionality.

Changeset 67064c1e930b

Parent a23f1a72c96e

committed by Profile picture of User 12Benjamin Pollack <benjamin@fogcreek.com>

Profile picture of User 12 authored by Benjamin Pollack <benjamin@fogcreek.com>

Changes to one file · Browse files at 67064c1e930b Showing diff from parent a23f1a72c96e Diff from another changeset...

Change 1 of 2 Show Entire File main.go Stacked
 
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
 
145
146
147
 
 
148
149
 
 
 
 
150
151
152
 
104
105
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
108
109
 
124
125
126
127
128
129
130
131
132
133
134
135
136
137
@@ -104,27 +104,6 @@
 }    func dispatch(k *kiln.KilnClient, repoPath string) { - // Handle help and logout specially, since they have odd behaviors - if len(os.Args) == 2 { - if os.Args[1] == "logout" { - if k.LoadCredentials() { - k.DeleteCredentials() - } - return - } else if os.Args[1] == "help" { - showHelp() - return - } - } - - if !k.LoadCredentials() { - if err := k.Logon(); err != nil { - fmt.Fprintf(os.Stderr, "unable to logon: %v\n", err) - os.Exit(1) - } - } - k.StoreCredentials() -   var command string   if len(os.Args) == 1 {   command = "history" @@ -145,8 +124,14 @@
  k.BrowseFileHistory(repoPath, file)   }   } + case "help": + showHelp()   case "history":   k.BrowseHistory(repoPath) + case "logout": + if k.LoadCredentials() { + k.DeleteCredentials() + }   case "related":   k.BrowseRelated(repoPath)   case "settings":