Skip to content

Commit

Permalink
Added 'version' command to cli.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martinsos committed Oct 29, 2020
1 parent 821e5c0 commit 4889fef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions waspc/cli/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Main where

import System.Environment
import Paths_waspc (version)
import Data.Version (showVersion)

import Command (runCommand)
import Command.Db (runDbCommand)
Expand All @@ -20,6 +22,7 @@ main = do
["clean"] -> runCommand clean
["compile"] -> runCommand compile
("db":dbArgs) -> dbCli dbArgs
["version"] -> printVersion
_ -> printUsage

printUsage :: IO ()
Expand All @@ -32,12 +35,19 @@ printUsage = putStrLn $ unlines
, " start"
, " clean"
, " db <commmand> [command-args]"
, " version"
, ""
, "Examples:"
, " wasp new MyApp"
, " wasp start"
, " wasp db migrate-save \"init\""
, ""
, "Documentation is available at https://wasp-lang.dev/docs ."
]

printVersion :: IO ()
printVersion = putStrLn $ showVersion version

-- TODO(matija): maybe extract to a separate module, e.g. DbCli.hs?
dbCli :: [String] -> IO ()
dbCli args = case args of
Expand Down
2 changes: 1 addition & 1 deletion waspc/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cabal file when you run `stack build`. See the hpack website for help with
# this file: <https://github.com/sol/hpack>.
name: waspc
version: 0.1.2.0
version: 0.1.4
github: "Martinsos/waspc"
#license: BSD3
author: "wasp-lang"
Expand Down

0 comments on commit 4889fef

Please sign in to comment.