summaryrefslogtreecommitdiff
path: root/src/GF/Command
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-27 09:09:29 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-27 09:09:29 +0000
commitf7b2a83059697f1b36a6369e489ac276e7ff875d (patch)
tree76e8394432f8f8a3c11b00e96cf65fa4f722d580 /src/GF/Command
parente8dc8c3ef5fa82c6bbab7ae8c7a4c75003af48c9 (diff)
version-related changes in Makefile and help
Diffstat (limited to 'src/GF/Command')
-rw-r--r--src/GF/Command/Abstract.hs7
-rw-r--r--src/GF/Command/Commands.hs13
-rw-r--r--src/GF/Command/Interpreter.hs7
-rw-r--r--src/GF/Command/Messages.hs54
4 files changed, 72 insertions, 9 deletions
diff --git a/src/GF/Command/Abstract.hs b/src/GF/Command/Abstract.hs
index 29111b432..1ae5d6dff 100644
--- a/src/GF/Command/Abstract.hs
+++ b/src/GF/Command/Abstract.hs
@@ -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
+
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index e161c623f..29f0bd61a 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -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)
+
+
diff --git a/src/GF/Command/Interpreter.hs b/src/GF/Command/Interpreter.hs
index db4192001..f4e3e220d 100644
--- a/src/GF/Command/Interpreter.hs
+++ b/src/GF/Command/Interpreter.hs
@@ -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
-
diff --git a/src/GF/Command/Messages.hs b/src/GF/Command/Messages.hs
new file mode 100644
index 000000000..8dda92d49
--- /dev/null
+++ b/src/GF/Command/Messages.hs
@@ -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"
+ ]