32
32
CommandLineParser::CommandLineParser(QStringList arguments, QObject* parent)
36
35
, m_fullscreen(false)
37
36
, m_url(DEFAULT_HOMEPAGE)
38
37
, m_remoteInspector(false)
41
41
QStringList args = arguments;
42
42
args.removeFirst();
49
49
if (argument.startsWith("-")) {
51
51
if (argument == "--chromeless") {
52
m_chromeFlags |= CHROMELESS;
53
53
} else if (argument == "--fullscreen") {
54
54
m_fullscreen = true;
55
55
} else if (argument == "--inspector") {
70
} else if (argument == "--enable-back-forward") {
71
m_chromeFlags |= BACK_FORWARD_BUTTONS;
72
} else if (argument == "--enable-activity") {
73
m_chromeFlags |= ACTIVITY_BUTTON | ADDRESS_BAR;
74
} else if (argument == "--enable-addressbar") {
75
m_chromeFlags |= ADDRESS_BAR;
70
76
} else if (argument.startsWith("--webapp")) {
71
77
// We use the name as a reference instead of the URL with a
72
78
// subsequent step to match it with a webapp.
122
128
QString command = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
123
129
out << "Usage: " << command << " [-h|--help] [--chromeless] [--fullscreen] [--homepage=URL] [URL]" << endl;
124
130
out << "Options:" << endl;
125
out << " -h, --help display this help message and exit" << endl;
126
out << " --chromeless do not display any chrome (web application mode)" << endl;
127
out << " --fullscreen display full screen" << endl;
128
out << " --homepage=URL override any URL passed as an argument" << endl;
129
out << " --inspector run a remote inspector on port " << REMOTE_INSPECTOR_PORT << endl;
130
out << " --webapp[=name] launch the browser as a webapp trying to match it by name with an installed webapp integration script (if any)" << endl;
131
out << " --app-id=APP_ID run the application with a specific APP_ID" << endl;
131
out << " -h, --help display this help message and exit" << endl;
132
out << " --fullscreen display full screen" << endl;
133
out << " --homepage=URL override any URL passed as an argument" << endl;
134
out << " --inspector run a remote inspector on port " << REMOTE_INSPECTOR_PORT << endl;
135
out << " --webapp[=name] launch the browser as a webapp trying to match it by name with an installed webapp integration script (if any)" << endl;
136
out << " --app-id=APP_ID run the application with a specific APP_ID" << endl;
132
137
out << " --webappUrlPatterns=url-patterns when running as a webapp (see --webapp), list of ',' separated url patterns (wildcard based) that the webapp can navigate to" << endl;
138
out << "Chrome options (if none specified, the whole chrome is enabled by default):" << endl;
139
out << " --chromeless do not display any chrome (web application mode), if set it overrides the other chrome options" << endl;
140
out << " --enable-back-forward enable the display of the back and forward buttons" << endl;
141
out << " --enable-activity enable the display of the activity button, the address bar is also displayed" << endl;
142
out << " --enable-addressbar enable the display of the address bar" << endl;
145
CommandLineParser::ChromeElementFlags CommandLineParser::chromeFlags() const
147
return m_chromeFlags;
135
150
QString CommandLineParser::appId() const