File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,7 @@ namespace parsertests
108108            parser.parse (argc, argv);
109109
110110            Assert::IsTrue (parser.do_record .get ());
111-             Assert::AreEqual (std::wstring (L" notepad.exe test_arg"  ), parser.record_commandline .get ());
112-             Assert::AreEqual (std::wstring (L" notepad.exe"  ), parser.sample_pe_file .get ());
111+             Assert::AreEqual (std::wstring (L" notepad.exe test_arg"  ), parser.double_dash .get ());
113112            Assert::IsTrue (COMMAND_CLASS::RECORD == parser.command );
114113        }
115114
Original file line number Diff line number Diff line change @@ -80,9 +80,9 @@ void arg_parser::parse(
8080        }
8181
8282        //  Parse the extra arguments after the "--" flag 
83-         if  (try_match_arg (raw_args, record_commandline )) {
83+         if  (try_match_arg (raw_args, double_dash )) {
8484            raw_args.erase (raw_args.begin ());
85-             parse_record_commandline (raw_args);
85+             parse_command_after_double_dash (raw_args);
8686            break ;
8787        }
8888
@@ -95,19 +95,18 @@ void arg_parser::parse(
9595}
9696
9797#pragma  region command line parsing after "--"
98- void  arg_parser::parse_record_commandline  (wstr_vec& raw_args_vect)
98+ void  arg_parser::parse_command_after_double_dash  (wstr_vec& raw_args_vect)
9999{
100100    while  (raw_args_vect.size () > 0 )
101101    {
102102        wstring arg = raw_args_vect.front ();
103103
104-         if  (sample_pe_file .value .empty ())
104+         if  (double_dash .value .empty ())
105105        {
106-             sample_pe_file.value  = arg;
107-             record_commandline.value  = arg;
106+             double_dash.value  = arg;
108107        }
109108        else  {
110-             record_commandline .value  += L"  "   + arg;
109+             double_dash .value  += L"  "   + arg;
111110        }
112111        raw_args_vect.erase (raw_args_vect.begin ());
113112    }
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ class arg_parser
233233#pragma  endregion
234234
235235#pragma  region Flags with arguments
236-     flag_with_argument record_commandline  = {
236+     flag_with_argument double_dash  = {
237237      L" --"  ,
238238      L" "  ,
239239      L" -- Process name is defined by COMMAND. User can pass verbatim arguments to the process with[ARGS]."  ,
@@ -431,7 +431,7 @@ class arg_parser
431431
432432#pragma  region Private Methods
433433private: 
434-     void  parse_record_commandline (wstr_vec& raw_args_vect);
434+     void  parse_command_after_double_dash (wstr_vec& raw_args_vect);
435435    bool  try_match_and_set_arg (wstr_vec& raw_args_vect, arg_type& flag);
436436    bool  try_match_and_set_arg (wstr_vec& raw_args_vect, flag_bool_type& flag);
437437    bool  try_match_and_set_arg (wstr_vec& raw_args_vect, flag_with_argument& flag);
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments