Skip to content

Commit

Permalink
Reorganise modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sullyj3 committed Aug 4, 2024
1 parent d813d5d commit 79dacd8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package sand where
srcDir := "src"

lean_lib Sand
lean_lib Daemon
lean_lib Client

@[default_target] lean_exe sand where
root := `Main
2 changes: 1 addition & 1 deletion src/Sand/SandClient.lean → src/Client.lean
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def runtimeDir : IO FilePath := do
def getSockPath : IO FilePath :=
runtimeDir <&> (· / "sand.sock")

def SandClient.main (args : List String) : IO UInt32 := do
def Client.main (args : List String) : IO UInt32 := do
let some cmd := parseArgs args | do
IO.println usage
IO.Process.exit 1
Expand Down
6 changes: 3 additions & 3 deletions src/Sand/SandDaemon.lean → src/Daemon.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import «Sand».Basic
import «Sand».Time
import «Sand».Message
import «Sand».Timers
import «Sand».SandDaemon.Basic
import «Sand».SandDaemon.HandleCommand
import «Daemon».Basic
import «Daemon».HandleCommand

open System (FilePath)

Expand Down Expand Up @@ -40,7 +40,7 @@ def envFd : IO (Option UInt32) := OptionT.run do

def systemdSockFd : UInt32 := 3

def SandDaemon.main (_args : List String) : IO α := do
def Daemon.main (_args : List String) : IO α := do
IO.eprintln s!"Starting Sand daemon {Sand.version}"

let fd ← match ← envFd with
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import «Sand».Message
import «Sand».SandDaemon.Basic
import «Daemon».Basic

open System (FilePath)
open Sand
Expand Down
8 changes: 5 additions & 3 deletions src/Main.lean
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Sand
import «Sand»
import «Daemon»
import «Client»

def version : IO UInt32 := do
println! "Sand {Sand.version}"
Expand All @@ -7,5 +9,5 @@ def version : IO UInt32 := do
def main (args : List String) : IO UInt32 := do
match args with
| ("version" :: _) => version
| ("daemon" :: rest) => SandDaemon.main rest
| _ => SandClient.main args
| ("daemon" :: rest) => Daemon.main rest
| _ => Client.main args
2 changes: 0 additions & 2 deletions src/Sand.lean
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
import «Sand».SandDaemon
import «Sand».SandClient

0 comments on commit 79dacd8

Please sign in to comment.