Commit 4ca968f4 authored by yoogx's avatar yoogx

* Add --list-backends option

        For issue #33
parent f0cdf131
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -54,6 +54,7 @@ package Ocarina.Options is
Show_Usage,
Parse_Scenario_Files_First,
Shell,
List_Backends,
Python_Shell);
After_Scenario_Action : Action_Kind := Generate_Code;
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -105,6 +105,9 @@ package body Ocarina.Cmd_Line is
Add_Library_Path (Parameter);
end if;
elsif Switch = "--list-backends" then
Set_Current_Action (List_Backends);
elsif Switch = "-o" then
Output_Filename := Get_String_Name (Parameter);
Generated_Sources_Directory := Output_Filename;
......@@ -273,6 +276,10 @@ package body Ocarina.Cmd_Line is
Define_Switch (Ocarina_Options, "-g:",
Help => "Generate code using Ocarina backend 'ARG'");
-- --list-backends flag
Define_Switch (Ocarina_Options, Long_Switch => "--list-backends",
Help => "List available backends");
-- -b flag
Define_Switch (Ocarina_Options,
Backends.Compile_Generated_Sources'Access, "-b",
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -559,7 +559,9 @@ begin
if Verbose then
Set_Standard_Error;
Version;
if not Display_Version then
Version;
end if;
end if;
if Display_Version then
......@@ -570,6 +572,10 @@ begin
Write_Line (Get_Name_String (Default_Library_Path));
OS_Exit (0);
elsif Get_Current_Action = List_Backends then
Write_Backends (1);
OS_Exit (0);
elsif Get_Current_Action = Shell then
Ocarina_Shell;
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