mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-21 02:39:31 -06:00
version-related changes in Makefile and help
This commit is contained in:
@@ -65,3 +65,10 @@ prOpt o = case o of
|
||||
mkOpt :: String -> Option
|
||||
mkOpt = OOpt
|
||||
|
||||
-- abbreviation convention from gf commands
|
||||
getCommandOp s = case break (=='_') s of
|
||||
(a:_,_:b:_) -> [a,b] -- axx_byy --> ab
|
||||
_ -> case s of
|
||||
[a,b] -> s -- ab --> ab
|
||||
a:_ -> [a] -- axx --> a
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import GF.Infra.UseIO
|
||||
import GF.Data.ErrM ----
|
||||
import PGF.Expr (readTree)
|
||||
import GF.Command.Abstract
|
||||
import GF.Command.Messages
|
||||
import GF.Text.Lexing
|
||||
import GF.Text.Transliterations
|
||||
|
||||
@@ -193,10 +194,16 @@ allCommands enc pgf = Map.fromList [
|
||||
"Without argument, shows the synopsis of all commands."
|
||||
],
|
||||
options = [
|
||||
("full","give full information of the commands")
|
||||
("changes","give a summary of changes from GF 2.9"),
|
||||
("coding","give advice on character encoding"),
|
||||
("full","give full information of the commands"),
|
||||
("license","show copyright and license information")
|
||||
],
|
||||
exec = \opts ts -> return ([], case ts of
|
||||
[t] -> let co = showTree t in
|
||||
_ | isOpt "changes" opts -> changesMsg
|
||||
_ | isOpt "coding" opts -> codingMsg
|
||||
_ | isOpt "license" opts -> licenseMsg
|
||||
[t] -> let co = getCommandOp (showTree t) in
|
||||
case lookCommand co (allCommands enc pgf) of ---- new map ??!!
|
||||
Just info -> commandHelp True (co,info)
|
||||
_ -> "command not found"
|
||||
@@ -612,3 +619,5 @@ infinity = 256
|
||||
|
||||
lookFlag :: PGF -> String -> String -> Maybe String
|
||||
lookFlag pgf lang flag = lookConcrFlag pgf (mkCId lang) (mkCId flag)
|
||||
|
||||
|
||||
|
||||
@@ -116,10 +116,3 @@ getCommandArg env a ts = case a of
|
||||
ATree t -> [t] -- ignore piped
|
||||
ANoArg -> ts -- use piped
|
||||
|
||||
-- abbreviation convention from gf commands
|
||||
getCommandOp s = case break (=='_') s of
|
||||
(a:_,_:b:_) -> [a,b] -- axx_byy --> ab
|
||||
_ -> case s of
|
||||
[a,b] -> s -- ab --> ab
|
||||
a:_ -> [a] -- axx --> a
|
||||
|
||||
|
||||
54
src/GF/Command/Messages.hs
Normal file
54
src/GF/Command/Messages.hs
Normal file
@@ -0,0 +1,54 @@
|
||||
module GF.Command.Messages where
|
||||
|
||||
licenseMsg = unlines [
|
||||
"Copyright (c)",
|
||||
"Krasimir Angelov, Bj\246rn Bringert, H\229kan Burden, Hans-Joachim Daniels,",
|
||||
"Markus Forsberg, Thomas Hallgren, Harald Hammarstr\246m, Kristofer Johannisson,",
|
||||
"Janna Khegai, Peter Ljungl\246f, Petri M\228enp\228\228, and",
|
||||
"Aarne Ranta, 1998-2008, under GNU General Public License (GPL)",
|
||||
"see LICENSE in GF distribution, or http://www.gnu.org/licenses/gpl.html."
|
||||
]
|
||||
|
||||
codingMsg = unlines [
|
||||
"The GF shell uses Unicode internally, but assumes user input to be UTF8",
|
||||
"and converts terminal and file output to UTF8. If your terminal is not UTF8",
|
||||
"see 'help set_encoding."
|
||||
]
|
||||
|
||||
changesMsg = unlines [
|
||||
"While GF 3.0 is backward compatible with source grammars, the shell commands",
|
||||
"have changed from version 2.9. Below the most importand changes. Bug reports",
|
||||
"and feature requests should be sent to http://trac.haskell.org/gf/.",
|
||||
"",
|
||||
"af use wf -append",
|
||||
"at not supported",
|
||||
"eh not yet supported",
|
||||
"es no longer supported; use javascript generation",
|
||||
"g not yet supported",
|
||||
"l now by default multilingual",
|
||||
"ml not yet supported",
|
||||
"p now by default multilingual",
|
||||
"pi not yet supported",
|
||||
"pl not yet supported",
|
||||
"pm subsumed to pg",
|
||||
"po not yet supported",
|
||||
"pt not yet supported",
|
||||
"r not yet supported",
|
||||
"rf changed syntax",
|
||||
"rl not supported",
|
||||
"s no longer needed",
|
||||
"sa not supported",
|
||||
"sf not supported",
|
||||
"si not supported",
|
||||
"so not yet supported",
|
||||
"t use pipe with l and p",
|
||||
"tb use l -treebank",
|
||||
"tl not yet supported",
|
||||
"tq changed syntax",
|
||||
"ts not supported",
|
||||
"tt use ps",
|
||||
"ut not supported",
|
||||
"vg not yet supported",
|
||||
"wf changed syntax",
|
||||
"wt not supported"
|
||||
]
|
||||
Reference in New Issue
Block a user