mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:22:46 +00:00 
			
		
		
		
	 25c2a76d10
			
		
	
	
		25c2a76d10
		
	
	
	
	
		
			
			Some POSIX utilities are specified to return a specific value on error, which is not 1. `Main::set_return_code_for_errors()` lets you set it to that value.
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			472 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			472 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 | |
|  * Copyright (c) 2022, the SerenityOS developers.
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Error.h>
 | |
| #include <AK/Span.h>
 | |
| #include <AK/StringView.h>
 | |
| 
 | |
| namespace Main {
 | |
| 
 | |
| struct Arguments {
 | |
|     int argc {};
 | |
|     char** argv {};
 | |
|     Span<StringView> strings;
 | |
| };
 | |
| 
 | |
| int return_code_for_errors();
 | |
| void set_return_code_for_errors(int);
 | |
| 
 | |
| }
 | |
| 
 | |
| ErrorOr<int> serenity_main(Main::Arguments);
 |