1module Stars exposing (run)
3import BackendTask exposing (BackendTask)
5import Cli.Option as Option
6import Cli.OptionsParser as OptionsParser
7import Cli.Program as Program
8import Json.Decode as Decode
9import Pages.Script as Script exposing (Script)
14 Script.withCliOptions program
15 (\{ username, repo } ->
16 BackendTask.Http.getJson
17 ("https://api.github.com/repos/dillonkearns/" ++ repo)
18 (Decode.field "stargazers_count" Decode.int)
19 |> BackendTask.allowFatal
20 |> BackendTask.andThen
22 Script.log (String.fromInt stars)
27type alias CliOptions =
33program : Program.Config CliOptions
37 (OptionsParser.build CliOptions
39 (Option.optionalKeywordArg "username" |> Option.withDefault "dillonkearns")
41 (Option.optionalKeywordArg "repo" |> Option.withDefault "elm-pages")
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list