Skip to content
Permalink
Browse files

Print project description when running examples-multi (#2)

* Print project description when running examples-multi
* Fix build command in README
* Only print description when 0 arguments
  • Loading branch information...
djmolo committed Apr 12, 2019
1 parent 46b3407 commit cc98b3fc7e0fa4cb8fedea081fb051ce23280554
Showing with 10 additions and 3 deletions.
  1. +10 −3 examples/multi/Main.hs
@@ -8,7 +8,7 @@

module Main where

import Control.Monad ( liftM, (<=<), (=<<) )
import Control.Monad ( when, liftM, (<=<), (=<<) )
import Control.Monad.Identity ( runIdentity )

import Data.Char ( toLower )
@@ -277,7 +277,8 @@ doTransform language transform file = do

main = do
args <- getArgs
if length args < 3 then
if length args < 3 then do
when (length args == 0) $ putStrLn description
putStrLn usage
else
let (language, cmd) = (downcase (args !! 0), downcase (args !! 1)) in
@@ -291,9 +292,15 @@ main = do
putStrLn usage


description :: String
description = "Cubix 0.1.0.0\n"
++ "Cubix is a framework for language-parametric program "
++ "transformation. It currently supports C, Java, JavaScript, "
++ "Lua, and Python.\n"

usage :: String
usage = "Usage:\n"
++ "examples-multi <language> <transform> <file>*\n"
++ "examples-multi <language> <analysis> <file>*\n"
++ "Transforms available: " ++ intercalate "," transformsList ++ "\n"
++ "Analyses available: " ++ intercalate ", " analsList ++ "\n"
++ "Analyses available: " ++ intercalate ", " analsList ++ "\n"

0 comments on commit cc98b3f

Please sign in to comment.
You can’t perform that action at this time.