Changeset a4da45e for tests/configs/usage.cfa
- Timestamp:
- Feb 26, 2024, 3:53:42 AM (19 months ago)
- Branches:
- master
- Children:
- 3f9a8d0
- Parents:
- 0522ebe (diff), 022bce0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/configs/usage.cfa
r0522ebe ra4da45e 10 10 // Author : Thierry Delisle 11 11 // Created On : Wed Oct 12 15:28:01 2022 12 // Last Modified By : 13 // Last Modified On : 14 // Update Count : 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Sun Feb 11 09:29:51 2024 14 // Update Count : 1 15 15 // 16 16 … … 24 24 25 25 sout | "No args, no errors"; 26 if (pid_t child = strict_fork(); child == 0) {26 if ( pid_t child = strict_fork(); child == 0 ) { 27 27 array( cfa_option, 0 ) opts; 28 print_args_usage(1, fake_argv, opts, "Test usage", false); 29 } 30 else { 31 int status = do_wait(child); 32 print_status(status); 33 } 28 print_args_usage(1, fake_argv, opts, "Test usage", false ); 29 } else { 30 int status = do_wait( child ); 31 print_status( status ); 32 } // if 34 33 35 34 sout | "No args, with errors"; 36 if (pid_t child = strict_fork(); child == 0) {35 if ( pid_t child = strict_fork(); child == 0 ) { 37 36 array( cfa_option, 0 ) opts; 38 print_args_usage(1, fake_argv, opts, "Test usage", true); 39 } 40 else { 41 int status = do_wait(child); 42 print_status(status); 43 } 37 print_args_usage(1, fake_argv, opts, "Test usage", true ); 38 } else { 39 int status = do_wait( child ); 40 print_status( status ); 41 } // if 44 42 45 43 sout | "Args with short names only:"; 46 if (pid_t child = strict_fork(); child == 0) {44 if ( pid_t child = strict_fork(); child == 0 ) { 47 45 int a, b, c; 48 46 array( cfa_option, 3 ) opts; … … 50 48 opts[1] = (cfa_option){'b', "", "Second arg", b }; 51 49 opts[2] = (cfa_option){'c', "", "Third arg", c }; 52 print_args_usage(1, fake_argv, opts, "Test usage", false); 53 } 54 else { 55 int status = do_wait(child); 56 print_status(status); 57 } 50 print_args_usage(1, fake_argv, opts, "Test usage", false ); 51 } else { 52 int status = do_wait( child ); 53 print_status( status ); 54 } // if 58 55 59 56 sout | "Args with long names only:"; 60 if (pid_t child = strict_fork(); child == 0) {57 if ( pid_t child = strict_fork(); child == 0 ) { 61 58 int a, b, c; 62 59 array( cfa_option, 3 ) opts; … … 64 61 opts[1] = (cfa_option){'\0', "BB", "Second arg", b }; 65 62 opts[2] = (cfa_option){'\0', "CC", "Third arg", c }; 66 print_args_usage(1, fake_argv, opts, "Test usage", false); 67 } 68 else { 69 int status = do_wait(child); 70 print_status(status); 71 } 63 print_args_usage(1, fake_argv, opts, "Test usage", false ); 64 } else { 65 int status = do_wait( child ); 66 print_status( status ); 67 } // if 72 68 73 69 sout | "Mix of short and long args:"; 74 if (pid_t child = strict_fork(); child == 0) {70 if ( pid_t child = strict_fork(); child == 0 ) { 75 71 int a, b, c; 76 72 array( cfa_option, 3 ) opts; … … 78 74 opts[1] = (cfa_option){'b', "BBBB", "Second arg", b }; 79 75 opts[2] = (cfa_option){'\0', "CC", "Third arg", c }; 80 print_args_usage(1, fake_argv, opts, "Test usage", false); 81 } 82 else { 83 int status = do_wait(child); 84 print_status(status); 85 } 76 print_args_usage(1, fake_argv, opts, "Test usage", false ); 77 } else { 78 int status = do_wait( child ); 79 print_status( status ); 80 } // if 86 81 87 82 sout | "Mix of short and long and some missing description:"; 88 if (pid_t child = strict_fork(); child == 0) {83 if ( pid_t child = strict_fork(); child == 0 ) { 89 84 int a, b, c; 90 85 array( cfa_option, 3 ) opts; … … 92 87 opts[1] = (cfa_option){'b', "BBBB", "", b }; 93 88 opts[2] = (cfa_option){'\0', "CC", "Third arg", c }; 94 print_args_usage(1, fake_argv, opts, "Test usage", false); 95 } 96 else { 97 int status = do_wait(child); 98 print_status(status); 99 } 89 print_args_usage(1, fake_argv, opts, "Test usage", false ); 90 } else { 91 int status = do_wait( child ); 92 print_status( status ); 93 } // if 100 94 101 95 sout | "Mix of short and long and some long description:"; 102 if (pid_t child = strict_fork(); child == 0) {96 if ( pid_t child = strict_fork(); child == 0 ) { 103 97 int a, b, c; 104 98 array( cfa_option, 3 ) opts; … … 106 100 opts[1] = (cfa_option){'b', "BBBB", "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", b }; 107 101 opts[2] = (cfa_option){'\0', "CC", "Third arg", c }; 108 print_args_usage(1, fake_argv, opts, "Test usage", false); 109 } 110 else { 111 int status = do_wait(child); 112 print_status(status); 113 } 102 print_args_usage(1, fake_argv, opts, "Test usage", false ); 103 } else { 104 int status = do_wait( child ); 105 print_status( status ); 106 } // if 114 107 } 115 108 116 109 // no used 117 static int true_main( const char * path, char * env[]) { return 0; }110 static int true_main( const char * path, char * env[]) { return 0; }
Note:
See TracChangeset
for help on using the changeset viewer.