github.com/haagen/force@v0.19.6-0.20140911230915-22addd930b34/whoami.go (about) 1 package main 2 3 import () 4 5 var cmdWhoami = &Command{ 6 Run: runWhoami, 7 Usage: "whoami", 8 Short: "Show information about the active account", 9 Long: ` 10 Show information about the active account 11 12 Examples: 13 14 force whoami 15 `, 16 } 17 18 func runWhoami(cmd *Command, args []string) { 19 force, _ := ActiveForce() 20 me, err := force.Whoami() 21 if err != nil { 22 ErrorAndExit(err.Error()) 23 } else if len(args) == 0 { 24 DisplayForceRecord(me) 25 } 26 }