Skip to content

Commit

Permalink
Merge pull request #38 from andrevidela/fix-cli-parsing
Browse files Browse the repository at this point in the history
Fix cli parsing
  • Loading branch information
andrevidela authored Jun 12, 2024
2 parents 6897c71 + f6d0f78 commit 7282c4c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
########################################################################

env:
IDRIS2_COMMIT: 24ac56de8809ae7a2cd0126f01110d4b762389fc
IDRIS2_COMMIT: 9e84b153bd3d7d5a63ec9e6a9adfa47a067ea172
COLLIE_COMMIT: ed2eda5e04fbd02a7728e915d396e14cc7ec298e
IDRALL_COMMIT: 62a455894b1db5134c8b56d31aadb31d483a4b2c
SCHEME: scheme
Expand Down
1 change: 1 addition & 0 deletions src/Katla/CLI.idr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Katla.HTML
import Katla.Engine

%default covering
%hide Collie.Modifiers.infix.(::=)

failWithUsage : {nm : _} -> Command nm -> IO ()
failWithUsage cmd
Expand Down
5 changes: 4 additions & 1 deletion src/Katla/Config.idr
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ export
getConfiguration : Backend -> (configFile : Maybe String) -> IO Config
getConfiguration backend Nothing = pure $ defaultConfig backend
getConfiguration backend (Just filename) = do
Right config <- liftIOEither (deriveFromDhallString {ty = Config} filename)
Right fileContent <- readFile filename
| Left err => putStrLn "Error reading file: \{show err}"
>> exitFailure
Right config <- liftIOEither (deriveFromDhallString {ty = Config} fileContent)
| Left err => do putStrLn """
Error while parsing configuration file \{filename}:
\{show err}
Expand Down
2 changes: 2 additions & 0 deletions src/Katla/LaTeX.idr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import System.File
import Collie
import Katla.Config

%hide Collie.Modifiers.infix.(::=)

export
escapeLatex : Char -> List Char
escapeLatex '-' = fastUnpack "\\KatlaDash{}"
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/init/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rm -rf temp
mkdir temp
# Test Katla
$1 latex init | tee temp/generated.dhall
$1 latex preamble --config ./temp/generated.dhall | tee temp/katla-preamble.tex
$1 latex preamble --config temp/generated.dhall | tee temp/katla-preamble.tex
$1 latex preamble --config ./temp/generated.dhall temp/katla-preamble-direct.tex


Expand Down

0 comments on commit 7282c4c

Please sign in to comment.