// /*-----------------------------------------------------------------*\ // | Main Program: Simple tester for Command_Line_Handler // |*-----------------------------------------------------------------*| // | Date: 23 February 1998 // | Author: Scott M. Pike // | // | Brief User's Manual: // | Allows user to test the Command_Line_Handler component from a // | unix prompt by entering "Command_Line_Handler_Test" followed by // | an arbitrary number of arguments. // | // \*-----------------------------------------------------------------*/ ///--------------------------------------------------------------------- /// Global Context ----------------------------------------------------- ///--------------------------------------------------------------------- #include "RESOLVE_Foundation.h" ///--------------------------------------------------------------------- /// Interface ---------------------------------------------------------- ///--------------------------------------------------------------------- program_body main (end_user_command_line) { object Character_OStream output; object Command_Line_Handler command_line; object Integer next_arg; output.Open_External (""); command_line.Get_Command_Line (command_line_arguments); output << "Command Line: " << command_line.Number_Of_Arguments () << " arguments\n\n"; while (next_arg < command_line.Number_Of_Arguments ()) { output << command_line[next_arg] << "\n"; next_arg++; } output.Close_External (); }