mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-31 23:22:17 +00:00 
			
		
		
		
	send cool-retro-term --help and --version to stdout
This commit is contained in:
		
							
								
								
									
										23
									
								
								app/main.cpp
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								app/main.cpp
									
									
									
									
									
								
							| @@ -60,23 +60,24 @@ int main(int argc, char *argv[]) | |||||||
|     // Manage command line arguments from the cpp side |     // Manage command line arguments from the cpp side | ||||||
|     QStringList args = app.arguments(); |     QStringList args = app.arguments(); | ||||||
|     if (args.contains("-h") || args.contains("--help")) { |     if (args.contains("-h") || args.contains("--help")) { | ||||||
|         // BUG: This usage help text goes to stderr, should go to stdout. |         QTextStream cout(stdout, QIODevice::WriteOnly); | ||||||
|         qDebug().noquote() << "Usage: " + args.at(0) + " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]"; |         cout << "Usage: " << args.at(0) << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << endl; | ||||||
|         qDebug() << "  --default-settings  Run cool-retro-term with the default settings"; |         cout << "  --default-settings  Run cool-retro-term with the default settings" << endl; | ||||||
|         qDebug() << "  --workdir <dir>     Change working directory to 'dir'"; |         cout << "  --workdir <dir>     Change working directory to 'dir'" << endl; | ||||||
|         qDebug() << "  -e <cmd>            Command to execute. This option will catch all following arguments, so use it as the last option."; |         cout << "  -e <cmd>            Command to execute. This option will catch all following arguments, so use it as the last option." << endl; | ||||||
|         qDebug() << "  -T <title>          Set window title to 'title'."; |         cout << "  -T <title>          Set window title to 'title'." << endl; | ||||||
|         qDebug() << "  --fullscreen        Run cool-retro-term in fullscreen."; |         cout << "  --fullscreen        Run cool-retro-term in fullscreen." << endl; | ||||||
|         qDebug() << "  -p|--profile <prof> Run cool-retro-term with the given profile."; |         cout << "  -p|--profile <prof> Run cool-retro-term with the given profile." << endl; | ||||||
|         qDebug() << "  -h|--help           Print this help."; |         cout << "  -h|--help           Print this help." << endl; | ||||||
|         qDebug() << "  --verbose           Print additional information such as profiles and settings."; |         cout << "  --verbose           Print additional information such as profiles and settings." << endl; | ||||||
|         return 0; |         return 0; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     QString appVersion("1.1.1"); |     QString appVersion("1.1.1"); | ||||||
|  |  | ||||||
|     if (args.contains("-v") || args.contains("--version")) { |     if (args.contains("-v") || args.contains("--version")) { | ||||||
|         qDebug() << ("cool-retro-term " + appVersion).toStdString().c_str(); |         QTextStream cout(stdout, QIODevice::WriteOnly); | ||||||
|  |         cout << "cool-retro-term " << appVersion << endl; | ||||||
| 	return 0; | 	return 0; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user