-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (51 loc) · 1.58 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"fmt"
"os"
"strings"
"github.com/gellel/emojipedia/arguments"
"github.com/gellel/emojipedia/slice"
)
func main() {
arguments := arguments.NewArguments(os.Args[1:])
switch strings.ToUpper(arguments.Get(0)) {
case C, CATEGORIES:
categoriesMain(arguments.Next())
case CC, CATEGORY:
categoryMain(arguments.Next())
case EE, EMOJI:
emojiMain(arguments.Next())
case E, EMOJIPEDIA:
emojipediaMain(arguments.Next())
case K, KEYWORDS:
keywordsMain(arguments.Next())
case S, SUBCATEGORIES:
subcategoriesMain(arguments.Next())
case SS, SUBCATEGORY:
subcategoryMain(arguments.Next())
case U, UNICODE:
unicodeorgMain(arguments.Next())
default:
fmt.Fprintln(writer, "usage: emojipedia [-abbreviation|verbose] <command> [args [...<args>]]")
fmt.Fprintln(writer)
fmt.Fprintln(writer, "Small program that scrapes unicode.org for emoji content. Parses out HTML into categorically ordered data subsets.")
fmt.Fprintln(writer)
fmt.Fprintln(writer, "building a new subprogram/getting started")
fmt.Fprintln(writer, building)
fmt.Fprintln(writer)
fmt.Fprintln(writer, "removing an installed package")
fmt.Fprintln(writer, removing)
fmt.Fprintln(writer)
fmt.Fprintln(writer, "browsing programs collection of contents")
slice.New(copt, kopt, eopt, sopt).Each(func(_ int, i interface{}) {
fmt.Fprintln(writer, i.(string))
})
fmt.Fprintln(writer)
fmt.Fprintln(writer, "browsing specific content")
slice.New(ccopt, eeopt, ssopt).Each(func(_ int, i interface{}) {
fmt.Fprintln(writer, i.(string))
})
fmt.Fprintln(writer)
writer.Flush()
}
}