Пример #1
0
void ProcessCommandLine(int argc, char* argv[])
{
	// Remove the first argument: the current application name...
	--argc; ++argv;
	while (argc > 0)
	{
		if (argv[0][0] == '-' || argv[0][0] == '/')
		{
			++(argv[0]);
			if (strcmp(argv[0], "-v") && argc >= 2)
			{
				isVerbose = FUStringConversion::ToBoolean(argv[1]);
				argc -= 2; argv += 2;
			}
			else
			{
				// unknown flag
				ShowHelp(); break;
			}
		}
		else if (argc == 1)
		{
			logFilename = TO_FSTRING((const char*) *(argv++));
			--argc;
		}
		else
		{
			ShowHelp(); break;
		}
	}
}
void 
ConnectionCommunity::OnWmConnectionHelp(HWND hwnd)
{
	int tab = TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_CONNTAB));

	switch(tab)
	{
	case 0:
		ShowHelp("http://sqlyogkb.webyog.com/article/151-getting-started");
		break;
	case 1:
		ShowHelp("http://sqlyogkb.webyog.com/article/155-connecting-using-http-tunneling");
		break;
	case 2:	
		ShowHelp("http://sqlyogkb.webyog.com/article/154-connecting-using-ssh-tunneling");
		break;
	case 3:
		ShowHelp("http://sqlyogkb.webyog.com/article/157-connecting-using-ssl-encryption");
		break;
	case 4:
		ShowHelp("http://sqlyogkb.webyog.com/article/252-advanced-tab");
		break;
	}
    return;
}
Пример #3
0
BOOL HelpContents()
{
#ifndef STANDALONE

	// If F1 was pressed, popup help in the context of the current tool. Use the tool's OpToken (of 
	// the form "TOOL<ToolId>") to look-up its help page. Fixes #10489
	if (KeyPress::IsKeyPressed(CAMKEY(F1)))
	{
		String OpToken;
		OpToken._MakeMsg( _T("TOOL%u"), Tool::GetCurrentID() );
		DWORD dwHelpIndex = LookupOperationTopic(OpToken);
		return ShowHelp(HELP_CONTEXT, dwHelpIndex);
	}

	return ShowHelp(HELP_FINDER, 0);

#else // STANDALONE
	// On the viewer go directly to the contents page on all OS's
	#ifdef WEBSTER
		return ShowHelp(HELP_CONTEXT, _R(IDH_Contents));
	#else //WEBSTER
		return ShowHelp(HELP_CONTEXT, _R(IDH_Misc_Contents));
	#endif // WEBSTER
#endif // STANDALONE
}
Пример #4
0
    int Application::Run()
    {
        auto& options = pimpl_->options;

        if (options.showHelp)
        {
            ShowHelp();
            return 0;
        }

        if (options.filename.empty())
        {
            internal::PrintInputError("no input file");
            ShowHelp();
            return 0;
        }

        blueprint::Parser parser;
        parser.SetListTypes(options.listTypes);
        parser.SetVerbose(options.verbose);
        parser.SetOutputDirectory(options.outputDir);
        parser.ParseWorkspace(options.filename);

        return 0;
    }
Пример #5
0
 void CCCountCLI::SetUp(int argc, char** argv)
 {
     po::options_description desc("USAGE: cjkcount [OPTION]+ [FILE]+\n\n"  
                                   "print the counts of total and distinguishable "
                                   "Chinese characters\nappeared in given file(s)\n\n"
                                   "If no file is provided, it reads text from stdin.\n\n" 
                                   "OPTIONS:\n");
     po::positional_options_description p;
     p.add("inputfile", -1);
     
     desc.add_options()
       ("help,h","show this message and exit")
       ("nosummary,S", "do not show the summary (default output) ")
       ("listall,l", "list all distinguishable Chinese characters appeared, with corresponding counting, "
         "sorted by the counts descendantly.")
       ("inputfile,f",po::value< vector<string> >(&_files),"input files");
     try
     {  
       po::store(po::command_line_parser(argc,argv).options(desc)
         .style(po::command_line_style::unix_style|
           po::command_line_style::allow_sticky|po::command_line_style::allow_guessing)
         .positional(p).run(),_ops);
       po::notify(_ops);      
       
     }
     catch(exception& e)
     {
       cout << e.what()<<endl;
       ShowHelp(desc,false);
     }
     if(_ops.count("help"))
       ShowHelp(desc);
 }
Пример #6
0
int main(int argc, char **argv) {
  android::base::InitLogging(argv);

  const std::string cmd_line = GetCommandLine(argc, argv);
  LOG(INFO) << "Service started: " << cmd_line;

  int opt = 0;
  while ((opt = getopt(argc, argv, "hlpr:")) != -1) {
    switch (opt) {
      case 'h': {
        ShowHelp(argv[0]);
        break;
      }

      case 'l': {
        LogBootEvents();
        break;
      }

      case 'p': {
        PrintBootEvents();
        break;
      }

      case 'r': {
        // |optarg| is an external variable set by getopt representing
        // the option argument.
        const char* event = optarg;

        BootEventRecordStore boot_event_store;
        boot_event_store.AddBootEvent(event);
        break;
      }

      default: {
        DCHECK_EQ(opt, '?');

        // |optopt| is an external variable set by getopt representing
        // the value of the invalid option.
        LOG(ERROR) << "Invalid option: " << optopt;
        ShowHelp(argv[0]);
        return EXIT_FAILURE;
      }
    }
  }

  return 0;
}
INT_PTR CALLBACK
CImportError::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	CImportError	*warn = (CImportError*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
		
	wyString		warnstr;
	
	switch(message)
	{
	case WM_INITDIALOG:
		SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
        LocalizeWindow(hwnd);
		PostMessage(hwnd, WM_INITDLGVALUES, 0, 0);
		return wyTrue;

	case WM_INITDLGVALUES:
		{
			warnstr.SetAs(warn->m_message);
			SetWindowText(GetDlgItem(hwnd, IDC_MESSAGE), warnstr.GetAsWideChar());	
			HICON icon = LoadIcon(NULL, IDI_INFORMATION);
            VERIFY(icon);
			SendMessage(GetDlgItem(hwnd, IDC_STATICIMG), STM_SETIMAGE, IMAGE_ICON, (LPARAM)(UINT)icon);
		}
		break;

	case WM_HELP:
		ShowHelp("http://sqlyogkb.webyog.com/article/235-excute-sql-script");
		return wyTrue;

	case WM_COMMAND:
		warn->OnWMCommand(hwnd, wParam);
		break;
	}
	return wyFalse;
}
Пример #8
0
int main(int argc, char** argv)
{
	std::map<std::string, std::string> args = ProcessArgs(argc, argv);

	if (args.size() != 5 || !ValidateArgs(args))
	{
		ShowHelp();
		return -5;
	}

	DesuraId id(args["-i"].c_str(), args["-t"].c_str());

	if (!Login(args["-u"], args["-p"]))
		return -1;

	if (!CreateMcf(id, args["-f"]))
		return -2;

	if (!StartUpload(id))
		return -3;

	if (!UploadMcf())
		return -4;

	return 0;
}
Пример #9
0
bool CSysLogQuery::triggerSlot(WObject *sender, const WSlot_ *slot, void **args)
{
  if (slot == slots_ + 0) {
    sender_ = sender;    SysLogBack();
    return true;
  }
  if (slot == slots_ + 1) {
    sender_ = sender;    SysLogForward();
    return true;
  }
  if (slot == slots_ + 2) {
    sender_ = sender;    SysLogReturnBtn();
    return true;
  }
  if (slot == slots_ + 3) {
    sender_ = sender;    SysLogQuery();
    return true;
  }
  if (slot == slots_ + 4) {
    sender_ = sender;    Translate();
    return true;
  }
  if (slot == slots_ + 5) {
    sender_ = sender;    ExChange();
    return true;
  }
  if (slot == slots_ + 6) {
	  sender_ = sender;    ShowHelp();
	  return true;
  }
  return WContainerWidget::triggerSlot(sender, slot, args);
}
Пример #10
0
 void OnEclHelp(UINT /*uNotifyCode*/, int /*nID*/, HWND /*hWnd*/)
 {
     CString message;
     m_dlgview.GetWordAtCurPosNoPeriodPlusHash(message);
     if (message[0])
         ShowHelp((const TCHAR *)message);
 }
Пример #11
0
int _tmain (int argc, _TCHAR **argv)
{

	if (argc < 2)
	{
		ShowHelp ();
		return (-1);
	}

	std::string	LicStorageImage;

	if (!ReadFile (argv[1], &LicStorageImage))
	{
		_tprintf (_T ("\nFailed to load file %s\n"), argv[1]);
		return (-1);
	}

	if (!DumpLicStorage (LicStorageImage))
	{
		return (-1);
	}

	return (0);

}
Пример #12
0
BOOL DeInitUserHelp()
{
PORTNOTETRACE("help", "Help function unimplemented!");
#if !defined(EXCLUDE_FROM_XARALX)
	// Tell the help engine we've finished using the help file(s).
	// NB. KNWON BUG: this doesn't do the job on Windows NT, leaving the helpfiles open.
	// As yet I have no idea why - it is as per the docs and works on Win32s & Chicago.
	if (fHaveUsedHelp)
	{
		TRACEUSER( "Ollie", _T("Closing general helpfile\n"));
		ShowHelp(HELP_QUIT, 0);
	}

#ifdef STANDALONE
	// Same if we ran the special helpfile.
	if (fHaveUsedSpecHelp)
	{
		TRACEUSER( "Ollie", _T("Closing special helpfile\n"));
		RunOilHelp(achzSpecPath, HELP_QUIT, 0);
	}
#endif

	// Remove our F1 message hook.
	return hF1Hook == NULL || ::UnhookWindowsHookEx(hF1Hook);
#else
	return TRUE;
#endif
}
Пример #13
0
BOOL HelpUserTopic(DWORD dwHelpIndex)
{
	if (dwHelpIndex == 0)
		return FALSE;
	
	// Show this topic in the help system and return a success code.
	return ShowHelp(HELP_CONTEXT, dwHelpIndex);
}
BOOL CDLUpdateDlg::OnHelpInfo(HELPINFO* pHelpInfo) 
{
	// TODO: Add your message handler code here and/or call default
    if (pHelpInfo->iContextType == HELPINFO_WINDOW){
        return ShowHelp(GetSafeHwnd(),pHelpInfo->dwContextId);
    }
    return TRUE;
}
Пример #15
0
BOOL HelpTechnicalSupport()
{
#ifdef WEBSTER
	return FALSE;
#else
	return ShowHelp(HELP_CONTEXT, _R(IDH_Misc_Tech_Support));
#endif
}
Пример #16
0
// Function to subclass the messageedit box. It is not used now but it is reserved for later
// use.
LRESULT	CALLBACK 
TabMessage::WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
{
	TabMessage* pcquerymessageedit = (TabMessage*)GetWindowLongPtr(hwnd, GWLP_USERDATA);

	switch(message)
	{
    case WM_COMMAND:
        pcquerymessageedit->OnWMCommand(wparam);
        break;

    case UM_FOCUS:
	    SetFocus(pcquerymessageedit->m_hwnd);
		break;

     case WM_HELP:
		ShowHelp("Messages%20Tab%20for%20SQLyog%20MySQL%20Management%20Tool.htm");
		return 1;

     case SCI_COPY:
     case WM_KEYDOWN:
        if(wparam == VK_INSERT || wparam == 'c' || wparam == 'C')
        {
            pcquerymessageedit->CopyTextToClipBoard();
            return 1;
        }
	    break;

	case WM_SETFOCUS:
	case WM_KEYUP:
	case WM_LBUTTONUP:
        PostMessage(pcquerymessageedit->m_pmdi->m_pctabmodule->m_hwnd, UM_SETSTATUSLINECOL, (WPARAM)hwnd, 1);
		break;
        
    case WM_KILLFOCUS:
        PostMessage(pcquerymessageedit->m_pmdi->m_pctabmodule->m_hwnd, UM_SETSTATUSLINECOL, (WPARAM)NULL, 0);
        break;

    case WM_DESTROY:
	    if(pcquerymessageedit->m_hfont)
        {
		    DeleteObject(pcquerymessageedit->m_hfont);
        }

	    pcquerymessageedit->m_hfont = NULL;
	    break;

    /*case WM_CONTEXTMENU:
        if(pcquerymessageedit->OnContextMenu(lparam) == wyTrue)
        {
            return 0;
        }

        break;*/
    }

    return CallWindowProc(pcquerymessageedit->m_wporigproc, hwnd, message, wparam, lparam);
}
Пример #17
0
int  main(int argc, char* argv[])
{
	if (argc<=1)
		return ShowHelp();
	// run
	if (GML::Utils::GString::Equals(argv[1],"run",true))
	{
		if (argc!=3)
			return Error("run command requare a parameter (a template file)");
		return Run(argv[2]);
	}
	// info
	if (GML::Utils::GString::Equals(argv[1],"info",true))
	{
		if (argc!=3)
			return Error("info command requare a parameter (a name for a an Algorithm, Conector, DataBase or Notifier)");
		return Info(argv[2]);
	}
	// desc
	if (GML::Utils::GString::Equals(argv[1],"desc",true))
	{
		if (argc!=4)
			return Error("desc command requare two parameters (a name for a an Algorithm, Conector, DataBase or Notifier and a property)");
		return Desc(argv[2],argv[3]);
	}
	// template
	if (GML::Utils::GString::Equals(argv[1],"template",true))
	{
		if ((argc!=4) && (argc!=3))
			return Error("template command requares a name for a an Algorithm, Conector, DataBase or Notifier");
		if (argc==3)
			return Template(argv[2],NULL);
		else
			return Template(argv[2],argv[3]);
	}
	// pytemplate
	if (GML::Utils::GString::Equals(argv[1],"pytemplate",true))
	{
		if (argc!=3)
			return Error("pytemplate command requares one parameter (a name for a an Algorithm, Conector, DataBase or Notifier)");
		return PyTemplate(argv[2]);
	}
	// algorithms
	if (GML::Utils::GString::Equals(argv[1],"algorithms",true))
		return ShowObjects(ALGORITHM_FOLDER,ALGORITHM_EXT);
	// connectors
	if (GML::Utils::GString::Equals(argv[1],"connectors",true))
		return ShowObjects(CONNECTOR_FOLDER,CONNECTOR_EXT);
	// notifiers
	if (GML::Utils::GString::Equals(argv[1],"notifiers",true))
		return ShowObjects(NOTIFYER_FOLDER,NOTIFYER_EXT);
	// databases
	if (GML::Utils::GString::Equals(argv[1],"databases",true))
		return ShowObjects(DATABASE_FOLDER,DATABASE_EXT);

	printf("[ERROR] Unknwon command : %s \n",argv[1]);
	return -1;
}
Пример #18
0
int main(int argc, char *argv[]) {

   if (argc > 2) {
      std::string command = argv[1];
      std::string file = argv[2];

      OutputFormat outFormat = OutputFormat::TEXT;
      if (argc > 3) { outFormat = ParseOutputFormat(argv[3]); }

      OleStructuredStorage::Oless *oleItem = new OleStructuredStorage::Oless(argv[2]);
      if (oleItem->IsOless()) {

         if (command == "list") {
            std::vector<OleSummary*> summary = oleItem->List();
            Output<OleSummary>(outFormat, file, "summary", summary);
         }
         else if (command == "guess") {
            std::vector<ExtensionInfo*> extensions = oleItem->Guess();
            Output<ExtensionInfo>(outFormat, file, "extensions", extensions);
         }
         else if (command == "dump") {
            if (argc > 4) {
               std::string outFile = argv[4];
               oleItem->Dump(argv[3], outFile);
            }
            else {
               ShowHelp();
            }
         }
         else {
            ShowHelp();
         }
      }
      else {
         std::cerr << file << ": Invalid OLESS header" << std::endl;
      }

   }
   else {
      ShowHelp();
   }

   return 0;
}
Пример #19
0
BOOL CPrefsID3V2HidePage::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
	NMHDR* pnmh = (LPNMHDR) lParam;
	if (pnmh->code == PSN_HELP)
	{
		ShowHelp();
	}
	
	return CSAPrefsSubDlg::OnNotify(wParam, lParam, pResult);
}
Пример #20
0
void usage() {

    conAdd(LLOW, GRAVIT_VERSION);
    conAdd(LLOW, GRAVIT_COPYRIGHT);
    conAdd(LLOW, "");
    conAdd(LLOW, "usage: gravit [-nvh] [COMMAND] ...");
    conAdd(LLOW, "");
//	ShowHelp("-e, --exec=COMMAND",	"execute a command. eg. --exec=\"load foo\"")
//	ShowHelp("",					"  commands will execute in order from left to right.")
    ShowHelp("-n, --noscript",		"don't load gravit configuration")
    ShowHelp("-h, --help",			"you're looking at it")
    ShowHelp("-v, --version",		"display version and quit")
    conAdd(LLOW, "");
    conAdd(LLOW, "  'COMMAND' should be encapsulated in quotes when there are spaces involved.");
    conAdd(LLOW, "  For example: gravit spawn record \"save mysim\" \"saveauto 20\"");
    conAdd(LLOW, "");
    cmdQuit(0);

}
Пример #21
0
void ShowCurrentHelpTopic()
{
	size_t FileNameSize=Info.EditorControl(-1,ECTL_GETFILENAME,0,0);
	LPWSTR FileName=NULL;
	Info.EditorControl(-1,ECTL_GETINFO,0,&ei);

	if (FileNameSize)
	{
		FileName=new wchar_t[FileNameSize];

		if (FileName)
		{
			Info.EditorControl(-1,ECTL_GETFILENAME,FileNameSize,FileName);
		}
	}

	switch (Opt.Style)
	{
		case 1:

			if (!(ei.CurState&ECSTATE_SAVED))
				ShowHelpFromTempFile();
			else
				ShowHelp(FileName,FindTopic());

			break;
		case 2:

			if (!(ei.CurState&ECSTATE_SAVED))
				Info.EditorControl(-1,ECTL_SAVEFILE, 0, 0);

		default:
			ShowHelp(FileName,FindTopic());
			break;
	}

	if (FileName)
	{
		delete[] FileName;
	}

}
Пример #22
0
LineParser &LineParser::parse( int argn, char *const *argv )
{
  int             val, arg, diff;
  Mixed           optional;
  const option_s *begin = &(*this->lp_data.pd_options.begin());

  while( (val = getopt_long(argn, argv, this->lp_data.pd_optstring.c_str(), begin, NULL)) != EOF ) {
    if( val == 'h' ) {
      this->lp_data.pd_progname.assign( argv[0] );
      throw ShowHelp( this->lp_data );
    }
    else if( val == '?' ) {
      this->lp_data.pd_progname.assign( argv[0] );
      throw InvalidOption( this->lp_data, optopt );
    }
    else if( this->lp_data.pd_argmap.count(val) != 0 ) {
      switch( this->lp_data.pd_argmap[val] ) {
      case no_argument:
	this->lp_map.insert( map<char, Mixed>::value_type((char) val, Mixed(true)) );
	break;
      case required_argument:
	this->lp_map.insert( map<char, Mixed>::value_type((char) val, Mixed(optarg)) );
	break;
      case optional_argument:
      default:
	if( optarg == NULL ) {
	  if( (optind < argn) && (argv[optind][0] != '-') ) {
	    optional.setStringValue( argv[optind] );
	    optind += 1;
	  }
	  else optional.setLogicalValue( true );
	}
	else optional.setStringValue( optarg );

	this->lp_map.insert( map<char, Mixed>::value_type((char) val, optional) );
	break;
      }
    }
  }

  diff = argn - optind;
  if( (((this->lp_data.pd_paramnumber == (int) ParserData::one_or_more) && (diff > 0)) ||
       ((this->lp_data.pd_paramnumber == (int) ParserData::zero_or_more) && (diff >= 0)) ||
       ((this->lp_data.pd_paramnumber >= 0) && (diff == this->lp_data.pd_paramnumber))) ) {
    for( arg = optind; arg < argn; arg++ )
      this->lp_arguments.push_back( argv[arg] );
  }
  else {
    this->lp_data.pd_progname.assign( argv[0] );
    throw InvalidArgNumber( this->lp_data, diff );
  }

  return *this;
}
Пример #23
0
static int ReadOptions(int argc, char **argv, DupOptions &dopt)
{
	Interactive = isatty(fileno(stdout));
	
	char opt;
	while ((opt = getopt(argc, argv, "ibhc:")) >= 0)
	{
		switch (opt)
		{
			case 'i':
				Interactive = true;
				break;
			case 'b':
				Interactive = false;
				break;
			case 'c':
				if ((*optarg == '>' || *optarg == '+') && (dopt.sz_min = ParseHumanSize(optarg+1)));
				else if ((*optarg == '<' || *optarg == '-') && (dopt.sz_max = ParseHumanSize(optarg+1)));
				else if ((*optarg == '=') && (dopt.sz_eq = ParseHumanSize(optarg+1)));
				else
				{
					fprintf(stderr, "Error: Invalid argument '%s' to option -l\n", optarg);
					exit(EXIT_FAILURE);
				}
				break;
			case 'h':
			default:
				ShowHelp(argv[0]);
				exit(EXIT_FAILURE);
				break;
		}
	}
	
	if (optind >= argc)
	{
		ShowHelp(argv[0]);
		exit(EXIT_FAILURE);
	}
	
	return optind;
}
Пример #24
0
BOOL _HelpUser(LPCTSTR lpcszClassName, UINT32 nSubTopic /* = 0 */)
{
	DWORD dwHelpIndex = LookupDialogTopic(lpcszClassName, nSubTopic);
	if (dwHelpIndex == 0)
	{
		TRACEUSER( "Ollie", _T("Can't find raw help topic for %s (sub %lu)\n"),
									lpcszClassName, nSubTopic);
		return FALSE;
	}

	return ShowHelp(HELP_CONTEXT, dwHelpIndex);
}
Пример #25
0
bool ShowCurrentHelpTopic()
{
	bool Result=true;
	wchar_t *FileName=GetEditorFileName();
	Info.EditorControl(-1,ECTL_GETINFO,0,&ei);

	switch (Opt.Style)
	{
		case 1:

			if (!(ei.CurState&ECSTATE_SAVED))
				ShowHelpFromTempFile();
			else
			{
				const wchar_t *Topic=FindTopic(false);
				if (!Topic)
					Topic=FindTopic(true);
				if (Topic && *Topic)
					ShowHelp(FileName,Topic,false);
				else
					Result=false;
			}

			break;
		case 2:

			if (!(ei.CurState&ECSTATE_SAVED))
				Info.EditorControl(-1,ECTL_SAVEFILE, 0, 0);

		default:
			ShowHelp(FileName,FindTopic(),false);
			break;
	}

	if (FileName)
		delete[] FileName;

	return Result;
}
Пример #26
0
void
CSumItApplication::MessageReceived(
	BMessage	*inMessage)
{
	switch (inMessage->what)
	{
		case msg_WindowAdded:
			break;
			
		case msg_WindowRemoved:
			if (CCellWindow::WindowCount() < 1)
				PostMessage(B_QUIT_REQUESTED);
			break;
			
		case msg_NewWindow:
			MakeNewWindow();
			break;
		
		case msg_Help:
			ShowHelp();
			break;
		
		case msg_OpenWindow:
		{
			if (fOpenPanel == NULL)
				fOpenPanel = new BFilePanel(B_OPEN_PANEL);
			if (fOpenPanel->IsShowing())
				fOpenPanel->Window()->Activate();
			else
			{
				BEntry entry;
				gCWD->GetEntry(&entry);
	
				entry_ref ref;
				entry.GetRef(&ref);
				fOpenPanel->SetPanelDirectory(&ref);
				fOpenPanel->Show();
			}
			break;
		}
			
		case msg_ShowClipboard:
			if (gClipboard->IsHidden()) gClipboard->Show();
			gClipboard->Activate();
			break;
			
		default:
			BApplication::MessageReceived(inMessage);
			break;
	}
}
Пример #27
0
int main(int argc, char **argv)
{
	int i;
	byte *mvd_data = NULL;
	long mvd_len = 0;

	Sys_InitDoubleTime();
	LogVarHashTable_Init();

	if (!Cmdline_Parse(argc, argv))
	{
		ShowHelp(argv[0]);
		return 1;
	}

	if (!Log_ParseOutputTemplates(&logger, cmdargs.template_file) && !Log_ParseOutputTemplates(&logger, "template.dat"))
	{
		Sys_PrintError("Failed to load template file.\n");
		return 1;
	}

	if (!LoadFragFile(cmdargs.frag_file, false) && !LoadFragFile("fragfile.dat", false))
	{
		Sys_PrintError("Failed to load fragfile.dat\n");
		return 1;
	}

	for (i = 0; i < cmdargs.mvd_files_count; i++)
	{
		// Read the mvd demo file.
		if (!COM_ReadFile(cmdargs.mvd_files[i], &mvd_data, &mvd_len))
		{
			Sys_PrintError("Failed to read %s.\n", cmdargs.mvd_files[i]);
		}
		else
		{
			char *demopath = cmdargs.mvd_files[i];

			// Parse the demo.
			Sys_Print("Starting to parse %s\n", cmdargs.mvd_files[i]);
			MVD_Parser_StartParse(demopath, mvd_data, mvd_len);
		}

		Q_free(mvd_data);
	}

	Log_ClearLogger(&logger);
	CmdArgs_Clear();

	return 0;
}
Пример #28
0
INT_PTR CALLBACK	
ImportBatch::DlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	ImportBatch * pcib = (ImportBatch*)GetWindowLongPtr(hwnd, GWLP_USERDATA);

	switch(message)
	{
	case WM_INITDIALOG:
		SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
        LocalizeWindow(hwnd);
		SendMessage(hwnd, WM_INITEXPORTDATA, 0, 0);
		break;

	case WM_INITEXPORTDATA:
        pcib->InitilizeExportData(hwnd);
		break;

	case UM_AFTEROK:
		{
			if(pcib->m_importing) 
    			pcib->m_stopimport = wyTrue;
	        else
            {
    			pcib->ExecuteBatch();
				pGlobals->m_pcmainwin->ChangeDBInCombo(pcib->m_tunnel, pcib->m_umysql);
            }
		}
		break;

	case WM_HELP:
		ShowHelp("http://sqlyogkb.webyog.com/article/235-excute-sql-script");
		return wyTrue;

	case WM_COMMAND:
        pcib->OnWMCommand(hwnd, wParam);
		break;

	case WM_DESTROY:
		delete pcib->m_p;
		break;

	case WM_MOUSEMOVE:
		pcib->OnWMMouseMove(hwnd, lParam);
		break;

	default:
		break;
	}	
	return wyFalse;
}
Пример #29
0
void ValidRunCmd(int argc, char *program[]) {
	//Verifica se foi informado nome/caminho do arquivo.
	if (argc < 2) {
		CodeCountError(program[0], "RUN_INIT");
	} else {
		if ((argc == 2) && (strcmp(program[1],"-h")==0 || strcmp(program[1],"-help")==0)) {
			ShowHelp();
		} else {
			if (argc > 2) {
				ValidArgs(argc, program);
			}
		}
	}
}
Пример #30
0
BOOL HelpUser(const DialogOp& DlgOp)
{
	// Work out which page within the dialog is visible, if appropriate.  We begin by
	// assuming this isn't relevant.
	UINT32 nPageResID = 0;
	if (DlgOp.IsKindOf(TABBED_DIALOG_CLASS))
	{
		// Work out which is the active (top-most) page within the tabbed dialog.
		wxWindow* pWnd = (wxWindow*) DlgOp.WindowID;
		if (pWnd != NULL)
		{
			// We got the window handle, get its MFC CWnd analogue.
			wxBookCtrlBase* pSheet = DialogManager::GetBookControl( pWnd );
			if (pSheet != NULL)
			{
				// Ask it for the resource ID of its currently active page.
				nPageResID = (UINT32) pSheet->GetCurrentPage()->GetId();
			}
#ifdef _DEBUG
			else
			{
				TRACEUSER( "Ollie", _T("Null OurPropSheet pointer in HelpUser\n"));
			}
#endif
		}
#ifdef _DEBUG
		else
		{
			TRACEUSER( "Ollie", _T("Null DialogOp window handle in HelpUser\n"));
		}
#endif
	}

	// Get the run-time class name etc of the dialog.
	LPCTSTR lpcszDialogClass = DlgOp.GetRuntimeClass()->m_lpszClassName;

	// Look-up the class name/page ID in our list of help topics.  If we can't find it
	// then we return a failure code.
	DWORD dwHelpIndex = LookupDialogTopic(lpcszDialogClass,	nPageResID);
	if (dwHelpIndex == 0)
	{
		TRACEUSER( "Ollie", _T("Can't find help topic for %s dialog (page ID %lu)\n"),
								(LPTSTR) lpcszDialogClass, (UINT32) nPageResID);
		return FALSE;
	}

	// Show this topic in the help system and return a success code.
	return ShowHelp(HELP_CONTEXT, dwHelpIndex);
}