Skip to content

Commit

Permalink
Convert the publish flag to a name
Browse files Browse the repository at this point in the history
  • Loading branch information
waybackarchiver committed Apr 10, 2022
1 parent 83f1cd2 commit 567017e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions publish/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"math/rand"
"net/url"
"os"
"strconv"
"strings"
"text/template"
"time"
Expand Down Expand Up @@ -65,7 +64,26 @@ type Publisher interface {

// String returns the flag as a string.
func (f Flag) String() string {
return strconv.Itoa(int(f))
switch f {
case FlagWeb:
return "httpd"
case FlagTelegram:
return "telegram"
case FlagTwitter:
return "twiter"
case FlagMastodon:
return "mastodon"
case FlagDiscord:
return "discord"
case FlagMatrix:
return "matrix"
case FlagSlack:
return "slack"
case FlagIRC:
return "irc"
default:
return "unknown"
}
}

func process(ctx context.Context, pub Publisher, cols []wayback.Collect, args ...string) {
Expand Down

0 comments on commit 567017e

Please sign in to comment.