Commit 5d731df3 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

remove "gui" subcommand

parent d93bc87b
S src S src
B _build/src B _build/src
PKG yojson log svg amr conll dep2pict libgrew_dev lablgtk2 lablwebkit containers PKG yojson log amr conll dep2pict libgrew_dev containers
...@@ -17,7 +17,7 @@ open Grew_utils ...@@ -17,7 +17,7 @@ open Grew_utils
module Grew_args = struct module Grew_args = struct
type mode = Undefined | Gui of string | Transform | Grep | Count | Valid | Stat | Compile | Clean | Test type mode = Undefined | Transform | Grep | Count | Valid | Stat | Compile | Clean | Test
let mode = ref Undefined let mode = ref Undefined
let grs = ref None let grs = ref None
...@@ -44,7 +44,6 @@ module Grew_args = struct ...@@ -44,7 +44,6 @@ module Grew_args = struct
""; "";
"subcommands are:"; "subcommands are:";
" transform Apply a GRS on a corpus"; " transform Apply a GRS on a corpus";
" gui Run the Gtk interface";
" grep Search for a pattern in a corpus"; " grep Search for a pattern in a corpus";
" version Print current version number"; " version Print current version number";
" help <sub> Print help for the given subcommand"; " help <sub> Print help for the given subcommand";
...@@ -54,22 +53,6 @@ module Grew_args = struct ...@@ -54,22 +53,6 @@ module Grew_args = struct
"----------------------------------------------------------"; "----------------------------------------------------------";
] ]
let help_gui () = List.iter (fun x -> Printf.printf "%s\n" x) [
"----------------------------------------------------------";
"usage: grew gui [<args>]";
"";
"This subcommand runs the GTK interface for Grew.";
"It supposes that the opam package \"grew_gui\" is installed.";
"";
"args are optionnal and can be change in the GUI:";
" -grs <file> The Graph Rewriting System to load";
" -i <file> The input data (a graph or a corpus)";
" -strat <name> The stategy used by default";
"";
"For additional information, see http://grew.fr";
"----------------------------------------------------------";
]
let help_grep () = List.iter (fun x -> Printf.printf "%s\n" x) [ let help_grep () = List.iter (fun x -> Printf.printf "%s\n" x) [
"----------------------------------------------------------"; "----------------------------------------------------------";
"usage: grew grep [<args>]"; "usage: grew grep [<args>]";
...@@ -142,7 +125,7 @@ module Grew_args = struct ...@@ -142,7 +125,7 @@ module Grew_args = struct
let parse () = let parse () =
match Array.to_list Sys.argv with match Array.to_list Sys.argv with
| [] -> failwith "bug: Empty argv" | [] -> failwith "bug: Empty argv"
| _ :: "gui" :: args -> mode := Gui (String.concat " " args) | _ :: "gui" :: _ -> Printf.printf "The gui mode is not longer supported"
| _ :: "transform" :: args -> mode := Transform; loop args | _ :: "transform" :: args -> mode := Transform; loop args
| _ :: "grep" :: args -> mode := Grep; loop args | _ :: "grep" :: args -> mode := Grep; loop args
| _ :: "count" :: args -> mode := Count; loop args | _ :: "count" :: args -> mode := Count; loop args
...@@ -154,7 +137,6 @@ module Grew_args = struct ...@@ -154,7 +137,6 @@ module Grew_args = struct
Printf.printf "libgrew: %s\n" (Libgrew.get_version ()); Printf.printf "libgrew: %s\n" (Libgrew.get_version ());
Printf.printf "grew: %s\n" VERSION; Printf.printf "grew: %s\n" VERSION;
| _ :: "test" :: args -> mode := Test; loop args | _ :: "test" :: args -> mode := Test; loop args
| _ :: "help" :: "gui" :: _ -> help_gui ()
| _ :: "help" :: "transform" :: _ -> help_transform () | _ :: "help" :: "transform" :: _ -> help_transform ()
| _ :: "help" :: "grep" :: _ -> help_grep () | _ :: "help" :: "grep" :: _ -> help_grep ()
| _ :: "help" :: "help" :: _ -> Printf.printf "Such a complex feature is still in development!\n" | _ :: "help" :: "help" :: _ -> Printf.printf "Such a complex feature is still in development!\n"
......
...@@ -344,11 +344,4 @@ let _ = ...@@ -344,11 +344,4 @@ let _ =
| Grew_args.Clean -> clean () | Grew_args.Clean -> clean ()
| Grew_args.Grep -> grep () | Grew_args.Grep -> grep ()
| Grew_args.Test -> failwith "No test defined" | Grew_args.Test -> failwith "No test defined"
| Grew_args.Gui args ->
let gui_exec = if Sys.argv.(0) = "grew_dev" then "grew_gui_dev" else "grew_gui" in
match Unix.system (gui_exec ^ " " ^ args) with
| Unix.WEXITED 127 -> Log.message "It seems that grew_gui is not installed on your system. See [http://grew.fr/gtk] for more information"
| _ -> ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment