summaryrefslogtreecommitdiff
path: root/src/tools/dcpomatic_server_cli.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-07-06 09:32:10 +0200
committerCarl Hetherington <cth@carlh.net>2024-07-06 09:32:10 +0200
commitfefcccd526bd4cf12dfdf43ce36ccb62b044528e (patch)
treec110a258ef02d131222417b4cbcb6872d4a8636c /src/tools/dcpomatic_server_cli.cc
parent0ca9937987ecf2bf3f579147ffc952838565415b (diff)
Add some missing ArgFixers for Windows command lines (#2844).
Diffstat (limited to 'src/tools/dcpomatic_server_cli.cc')
-rw-r--r--src/tools/dcpomatic_server_cli.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tools/dcpomatic_server_cli.cc b/src/tools/dcpomatic_server_cli.cc
index 6d7f6aba7..023099034 100644
--- a/src/tools/dcpomatic_server_cli.cc
+++ b/src/tools/dcpomatic_server_cli.cc
@@ -62,6 +62,9 @@ help (string n)
int
main (int argc, char* argv[])
{
+ ArgFixer fixer(argc, argv);
+ auto const program_name = fixer.argv()[0];
+
dcpomatic_setup_path_encoding ();
dcpomatic_setup ();
@@ -80,7 +83,7 @@ main (int argc, char* argv[])
{ 0, 0, 0, 0 }
};
- int c = getopt_long (argc, argv, "vht:AB", long_options, &option_index);
+ int c = getopt_long(fixer.argc(), fixer.argv(), "vht:AB", long_options, &option_index);
if (c == -1) {
break;
@@ -91,7 +94,7 @@ main (int argc, char* argv[])
cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n";
exit (EXIT_SUCCESS);
case 'h':
- help (argv[0]);
+ help(program_name);
exit (EXIT_SUCCESS);
case 't':
num_threads = atoi (optarg);
@@ -115,12 +118,12 @@ main (int argc, char* argv[])
server.run ();
} catch (boost::system::system_error& e) {
if (e.code() == boost::system::errc::address_in_use) {
- cerr << argv[0] << ": address already in use. Is another DCP-o-matic server instance already running?\n";
+ cerr << program_name << ": address already in use. Is another DCP-o-matic server instance already running?\n";
exit (EXIT_FAILURE);
}
- cerr << argv[0] << ": " << e.what() << "\n";
+ cerr << program_name << ": " << e.what() << "\n";
} catch (std::exception& e) {
- cerr << argv[0] << ": failed to start server; " << e.what() << "\n";
+ cerr << program_name << ": failed to start server; " << e.what() << "\n";
}
return 0;
}