File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import Terminal.Run
1616import Terminal.Help
1717import Terminal.Repl
1818import Terminal.Report exposing (Report)
19+ import Terminal.Format
1920import Compiler.Backend
2021import Compiler.PackageName as PackageName exposing (PackageName)
2122import Compiler.Paths
@@ -839,6 +840,13 @@ parseUserArgs model compilerPath =
839840 |> Task.onError endWithErrorString
840841 |> Task.perform RunCmd
841842
843+ CliParser.Format ->
844+ Terminal.Format.run
845+ { stdout = model.stdout
846+ }
847+ |> Task.map (\_ -> Cmd.none)
848+ |> Task.perform RunCmd
849+
842850
843851resolveProject : Model -> Task Report Terminal.PackageInstall.PackageResolution
844852resolveProject model =
Original file line number Diff line number Diff line change 1+ module Terminal.Format exposing
2+ ( Config
3+ , run
4+ )
5+
6+
7+ import Stream
8+ import Stream.Log
9+ import Task exposing (Task)
10+ import Bytes exposing (Bytes)
11+
12+
13+ type alias Config =
14+ { stdout : Stream.Writable Bytes
15+ }
16+
17+
18+ run : Config -> Task x {}
19+ run config =
20+ Stream.Log.line config.stdout "TODO"
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ type Command
3131 | PackageDiff DiffArgs
3232 | Paths Paths.Options
3333 | Run RunOptions
34+ | Format
3435
3536
3637type alias InitFlags =
@@ -203,6 +204,20 @@ parser =
203204 , builder =
204205 \_args flags -> Paths flags
205206 }
207+ |> CLI.Parser.withCommand
208+ { word = "format"
209+ , arguments =
210+ CLI.Parser.noArgs
211+ , flags =
212+ CLI.Parser.noFlags
213+ , commonDescription = Nothing
214+ , summary =
215+ "Format Gren source code."
216+ , example =
217+ PP.empty
218+ , builder =
219+ \_args _flags -> Format
220+ }
206221 |> CLI.Parser.withCommand
207222 { word = "make"
208223 , arguments =
You can’t perform that action at this time.
0 commit comments