mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-26 06:03:32 +00:00
35 lines
696 B
Go
35 lines
696 B
Go
// +build !rm_basic_commands allcommands followcmd
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func init() {
|
|
command := Command{
|
|
Cmd: []string{"follow"},
|
|
Description: "$username - Follows the given user",
|
|
Help: "",
|
|
Exec: cmdFollow,
|
|
}
|
|
RegisterCommand(command)
|
|
}
|
|
|
|
func cmdFollow(cmd []string) {
|
|
if len(cmd) == 2 {
|
|
go follow(cmd[1])
|
|
} else {
|
|
printFollowHelp()
|
|
}
|
|
}
|
|
func follow(username string) {
|
|
k.Exec("follow", username, "-y")
|
|
printInfoF("Now follows $TEXT", config.Colors.Message.LinkKeybase.stylize(username))
|
|
followedInSteps[username] = 1
|
|
}
|
|
|
|
func printFollowHelp() {
|
|
printInfo(fmt.Sprintf("To follow a user use %sfollow <username>", config.Basics.CmdPrefix))
|
|
}
|