From 4889fefd0f40422f4585475a62f159af3f899005 Mon Sep 17 00:00:00 2001 From: Martin Sosic Date: Thu, 29 Oct 2020 13:15:13 +0100 Subject: [PATCH] Added 'version' command to cli. --- waspc/cli/Main.hs | 10 ++++++++++ waspc/package.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/waspc/cli/Main.hs b/waspc/cli/Main.hs index 9a36c3308b..f327d30420 100644 --- a/waspc/cli/Main.hs +++ b/waspc/cli/Main.hs @@ -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) @@ -20,6 +22,7 @@ main = do ["clean"] -> runCommand clean ["compile"] -> runCommand compile ("db":dbArgs) -> dbCli dbArgs + ["version"] -> printVersion _ -> printUsage printUsage :: IO () @@ -32,12 +35,19 @@ printUsage = putStrLn $ unlines , " start" , " clean" , " db [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 diff --git a/waspc/package.yaml b/waspc/package.yaml index 300963d355..41e1a2278d 100644 --- a/waspc/package.yaml +++ b/waspc/package.yaml @@ -2,7 +2,7 @@ # Cabal file when you run `stack build`. See the hpack website for help with # this file: . name: waspc -version: 0.1.2.0 +version: 0.1.4 github: "Martinsos/waspc" #license: BSD3 author: "wasp-lang"