Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Enhanced the "usage" message and fixed misdocumented behaviour of "--load-plugins" #9

Merged
1 commit merged into from
Feb 28, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pro.user
9 changes: 7 additions & 2 deletions src/phantomjs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@

void showUsage()
{
std::cerr << "phantomjs script.js" << std::endl << std::endl;
std::cerr << "Usage: phantomjs [options] script.js [argument [argument ...]]" << std::endl << std::endl;
std::cerr << "Options:" << std::endl;
std::cerr << "\t--load-images=[yes|no]\t\tLoad all inlined images (default is 'yes')." << std::endl;
std::cerr << "\t--load-plugins=[yes|no]\tLoad all plugins (i.e. 'Flash', 'Silverlight', ...) (default is 'no')." << std::endl;
std::cerr << "\t--upload-file fileId=/file/path\tUpload a file by creating a '<input type=\"file\" id=\"foo\" />'\n"
"\t\t\t\tand calling phantom.setFormInputFile(document.getElementById('foo', 'fileId')." << std::endl;
}

class WebPage: public QWebPage
Expand Down Expand Up @@ -175,7 +180,7 @@ Phantom::Phantom(QObject *parent)
m_page.setPalette(palette);

bool autoLoadImages = true;
bool pluginsEnabled = true;
bool pluginsEnabled = false;

// second argument: script name
QStringList args = QApplication::arguments();
Expand Down