diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-02-02 19:08:06 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-02-02 19:08:06 +0000 |
commit | c53f12b1de543dc1fe9c6adf62655068c37e405d (patch) | |
tree | ea0f045c271bf166823c738e7a023da51875b154 /shell/command_line_arguments.adb | |
parent | e5636e3951c806b378bdc56dd731ffad7cea28d3 (diff) |
2011-02-02 Joel Sherrill <joel.sherrill@gmail.com>
* commands.adb, commands.ads, rtems_shell.ads, shell.adb: Add getopt_r
Package and example command.
* command_line_arguments.adb, command_line_arguments.ads, getopt_r.adb,
getopt_r.ads: New files.
Diffstat (limited to 'shell/command_line_arguments.adb')
-rw-r--r-- | shell/command_line_arguments.adb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/shell/command_line_arguments.adb b/shell/command_line_arguments.adb new file mode 100644 index 0000000..0610d67 --- /dev/null +++ b/shell/command_line_arguments.adb @@ -0,0 +1,19 @@ +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Interfaces.C.Pointers; +with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; + +package body Command_Line_Arguments is + + function Get_Argument( + Argv : Argument_Vector_Type; + Index : Argument_Count_Type) + return String is + Arguments : Argument_Array(1 .. Index); + begin + Arguments := Argument_Vector_Package.Value (ArgV, Index); + + return To_String (To_Unbounded_String (Value(Arguments (Index)))); + end Get_Argument; + +end Command_Line_Arguments; |