2 * Copyright (c) 2021, S. Gilles <sgilles@sgilles.net>
4 * Permission to use, copy, modify, and/or distribute this software
5 * for any purpose with or without fee is hereby granted, provided
6 * that the above copyright notice and this permission notice appear
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <QApplication>
29 main(int argc
, char *argv
[])
32 /* The only option is [ -d <directory> ] */
34 char *explicit_data_dir_str
= nullptr;
36 while ((c
= getopt(argc
, argv
, "d:")) != -1) {
41 explicit_data_dir_str
= optarg
;
48 /* Read in the cards */
49 std::filesystem::path data_dir
;
51 if (explicit_data_dir_str
) {
52 data_dir
= std::filesystem::path(explicit_data_dir_str
);
54 data_dir
= Util::find_data_dir();
57 Session
session(data_dir
);
60 QCoreApplication::setOrganizationName("sispare");
61 QCoreApplication::setApplicationName("sispare-qt");
62 QApplication
qa(argc
, argv
);
68 } catch (const std::exception
& ex
) {
69 Util::output_nested_ex(ex
);