Skip to content

Commit

Permalink
Merge pull request supercollider#4950 from geoffroymontel/topic/add-b…
Browse files Browse the repository at this point in the history
…asic-usage-for-scide

add -h and --help to SC Ide executable to show usage, solves supercollider#3511
  • Loading branch information
dyfer authored May 21, 2020
2 parents fd0f8a3 + 33895e8 commit 948e8c0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions editors/sc-ide/core/main_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,27 @@

#include "util/HelpBrowserWebSocketServices.hpp"

#include <iostream>
#include <string>

using namespace ScIDE;

static void show_usage(std::string name) {
std::cerr << "Usage: " << name << " <option(s)> [file1.scd file2.scd ...]\n"
<< "Options:\n"
<< "\t-h, --help\tShow this help message\n"
<< std::endl;
}

int main(int argc, char* argv[]) {
for (int i = 1; i < argc; ++i) {
std::string arg = argv[i];
if ((arg == "-h") || (arg == "--help")) {
show_usage(argv[0]);
return 0;
}
}

QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
// In order to scale the UI properly on Windows with display scaling like 125% or 150%
// we need to disable scale factor rounding
Expand Down

0 comments on commit 948e8c0

Please sign in to comment.