Commit 4ca968f4 authored by yoogx's avatar yoogx
Browse files

* Add --list-backends option

        For issue #33
parent f0cdf131
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -54,6 +54,7 @@ package Ocarina.Options is ...@@ -54,6 +54,7 @@ package Ocarina.Options is
Show_Usage, Show_Usage,
Parse_Scenario_Files_First, Parse_Scenario_Files_First,
Shell, Shell,
List_Backends,
Python_Shell); Python_Shell);
After_Scenario_Action : Action_Kind := Generate_Code; After_Scenario_Action : Action_Kind := Generate_Code;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2015 ESA & ISAE. -- -- Copyright (C) 2015-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -105,6 +105,9 @@ package body Ocarina.Cmd_Line is ...@@ -105,6 +105,9 @@ package body Ocarina.Cmd_Line is
Add_Library_Path (Parameter); Add_Library_Path (Parameter);
end if; end if;
elsif Switch = "--list-backends" then
Set_Current_Action (List_Backends);
elsif Switch = "-o" then elsif Switch = "-o" then
Output_Filename := Get_String_Name (Parameter); Output_Filename := Get_String_Name (Parameter);
Generated_Sources_Directory := Output_Filename; Generated_Sources_Directory := Output_Filename;
...@@ -273,6 +276,10 @@ package body Ocarina.Cmd_Line is ...@@ -273,6 +276,10 @@ package body Ocarina.Cmd_Line is
Define_Switch (Ocarina_Options, "-g:", Define_Switch (Ocarina_Options, "-g:",
Help => "Generate code using Ocarina backend 'ARG'"); Help => "Generate code using Ocarina backend 'ARG'");
-- --list-backends flag
Define_Switch (Ocarina_Options, Long_Switch => "--list-backends",
Help => "List available backends");
-- -b flag -- -b flag
Define_Switch (Ocarina_Options, Define_Switch (Ocarina_Options,
Backends.Compile_Generated_Sources'Access, "-b", Backends.Compile_Generated_Sources'Access, "-b",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2004-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -559,7 +559,9 @@ begin ...@@ -559,7 +559,9 @@ begin
if Verbose then if Verbose then
Set_Standard_Error; Set_Standard_Error;
Version; if not Display_Version then
Version;
end if;
end if; end if;
if Display_Version then if Display_Version then
...@@ -570,6 +572,10 @@ begin ...@@ -570,6 +572,10 @@ begin
Write_Line (Get_Name_String (Default_Library_Path)); Write_Line (Get_Name_String (Default_Library_Path));
OS_Exit (0); OS_Exit (0);
elsif Get_Current_Action = List_Backends then
Write_Backends (1);
OS_Exit (0);
elsif Get_Current_Action = Shell then elsif Get_Current_Action = Shell then
Ocarina_Shell; Ocarina_Shell;
OS_Exit (0); OS_Exit (0);
......
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