mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-24 10:22:50 -06:00
Add more helpful printouts if no grammar provided
This commit is contained in:
@@ -87,9 +87,11 @@ main = do
|
|||||||
|
|
||||||
args <- cmdArgs gftest
|
args <- cmdArgs gftest
|
||||||
|
|
||||||
let (absName,grName) = case grammar args of
|
case grammar args of
|
||||||
Just fp -> (takeFileName $ stripPGF fp, stripPGF fp ++ ".pgf") --doesn't matter if the name is given with or without ".pgf"
|
Nothing -> putStrLn "Usage: `gftest -g <PGF grammar> [OPTIONS]'\nTo see available commands, run `gftest --help' or visit https://github.com/GrammaticalFramework/GF/blob/master/src/tools/gftest/README.md"
|
||||||
Nothing -> ("TestLang","TestLang.pgf") -- feel free to add your own default paths here
|
Just fp -> do
|
||||||
|
let (absName,grName) = (takeFileName $ stripPGF fp, stripPGF fp ++ ".pgf") --doesn't matter if the name is given with or without ".pgf"
|
||||||
|
|
||||||
(langName:langTrans) = case lang args of
|
(langName:langTrans) = case lang args of
|
||||||
[] -> [ absName ++ "Eng" ] -- if no English grammar found, it will be given a default value later
|
[] -> [ absName ++ "Eng" ] -- if no English grammar found, it will be given a default value later
|
||||||
langs -> [ absName ++ t | t <- words langs ]
|
langs -> [ absName ++ t | t <- words langs ]
|
||||||
@@ -354,7 +356,6 @@ main = do
|
|||||||
| (cat,_,_,_) <- difcats
|
| (cat,_,_,_) <- difcats
|
||||||
, let funs = functionsByCat grammar cat ]
|
, let funs = functionsByCat grammar cat ]
|
||||||
|
|
||||||
|
|
||||||
sortByName = sortBy (\s t -> name s `compare` name t)
|
sortByName = sortBy (\s t -> name s `compare` name t)
|
||||||
writeFunFile groupedFuns file grammar = do
|
writeFunFile groupedFuns file grammar = do
|
||||||
writeFile file ""
|
writeFile file ""
|
||||||
|
|||||||
Reference in New Issue
Block a user