Changeset 67064c1e930b…
Parent a23f1a72c96e…
committed by Benjamin Pollack <benjamin@fogcreek.com>
authored by Benjamin Pollack <benjamin@fogcreek.com>
Changes to one file · Browse files at 67064c1e930b Showing diff from parent a23f1a72c96e Diff from another changeset...
@@ -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":
|
Loading...