Skip to content
Snippets Groups Projects
CommandLine.cpp 39 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        if(argv[i])
          CTX::instance()->deltaFontSize = atoi(argv[i++]);
          Msg::Fatal("Missing number");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(argv[i] + 1, "theme") || !strcmp(argv[i] + 1, "scheme")) {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        if(argv[i])
          CTX::instance()->guiTheme = argv[i++];
          Msg::Fatal("Missing argument");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(argv[i] + 1, "display")) {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        if(argv[i])
          CTX::instance()->display = argv[i++];
          Msg::Fatal("Missing argument");
      else if(!strcmp(argv[i] + 1, "showCompounds")) {
        CTX::instance()->geom.hideCompounds = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#endif
#if defined(__APPLE__)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strncmp(argv[i] + 1, "psn", 3)) {
        // the Mac Finder launches programs with a special command line argument
        // of the form -psn_XXX: just ignore it silently (and don't exit!)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        i++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
#endif
      else {
        Msg::Error("Unknown option '%s'", argv[i]);
        PrintUsage(argv[0]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    }
      CTX::instance()->files.push_back(argv[i++]);
  if(CTX::instance()->files.empty()){
    std::string base = (getenv("PWD") ? "" : CTX::instance()->homeDir);
    GModel::current()->setFileName(base + CTX::instance()->defaultFileName);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
  else
    GModel::current()->setFileName(CTX::instance()->files[0]);
  CTX::instance()->terminal = terminal;