diff --git a/main.go b/main.go index 1ee2454..6cf1ac1 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,8 @@ package main import ( "flag" "fmt" + "gitlab.com/golang-commonmark/linkify" + "html" "io/ioutil" "os" "os/user" @@ -40,6 +42,7 @@ func main() { func GetStatus(args []string) { getFlags := flag.NewFlagSet(os.Args[0]+" get", flag.ExitOnError) freshDays := getFlags.Int("freshness", 14, "get all statuses newer than this number of days") + htmlOutput := getFlags.Bool("output-html", false, "output statuses as a list of HTML links") getFlags.Parse(args) freshLimit := time.Now().AddDate(0, 0, *freshDays*-1) @@ -62,6 +65,10 @@ func GetStatus(args []string) { } } + if *htmlOutput { + fmt.Println("") + } return } @@ -191,7 +250,7 @@ func GetFriendlyWd(curUser *user.User) (string, error) { } // If the path is within the user's public_html directory, return an http link. - weblessPath := strings.TrimPrefix(homelessPath, "public_html/") + weblessPath := strings.TrimPrefix(homelessPath, "public_html") if weblessPath != homelessPath { return fmt.Sprintf("https://tilde.town/~%s/%s", curUser.Username, weblessPath), nil }