1module AddStaticRoute exposing (run)
4import Cli.Option as Option
5import Cli.OptionsParser as OptionsParser
6import Cli.Program as Program
8import Elm.Annotation as Type
12import Gen.Effect as Effect
13import Gen.Html as Html
14import Gen.Platform.Sub
16import Pages.Script as Script exposing (Script)
17import Scaffold.Route exposing (Type(..))
20type alias CliOptions =
21 { moduleName : List String
27 Script.withCliOptions program
32 |> BackendTask.allowFatal
36program : Program.Config CliOptions
40 (OptionsParser.build CliOptions
41 |> OptionsParser.with (Option.requiredPositionalArg "module" |> Scaffold.Route.moduleNameCliArg)
45createFile : CliOptions -> { path : String, body : String }
46createFile { moduleName } =
47 Scaffold.Route.preRender
48 { moduleName = moduleName
50 Gen.BackendTask.succeed
53 ( Alias (Type.record [])
55 Gen.BackendTask.succeed (Elm.record [])
57 , head = \app -> Elm.list []
59 |> Scaffold.Route.buildWithLocalState
61 \{ shared, model, app } ->
63 { title = moduleName |> String.join "." |> Elm.string
66 [ Html.h2 [] [ Html.text "New Page" ]
70 \{ shared, app, msg, model } ->
73 [ Elm.Case.branch (Elm.Arg.customType "NoOp" ())
81 Elm.tuple (Elm.record []) Effect.none
83 \{ routeParams, path, shared, model } ->
86 Alias (Type.record [])
88 Custom [ Elm.variant "NoOp" ]
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