#include "wx/numdlg.h"
#include "wx/textdlg.h"
#include "wx/ffile.h"
+#include "wx/stopwatch.h"
#include "wx/process.h"
void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
{
+ if ( !m_cmdLast )
+ {
+#ifdef __WXMSW__
+ m_cmdLast = "type Makefile.in";
+#else
+ m_cmdLast = "cat -n Makefile";
+#endif
+ }
+
wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
if ( sync )
{
- wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() );
+ wxLogStatus("\"%s\" is running please wait...", cmd);
+
+ wxStopWatch sw;
wxArrayString output, errors;
int code = wxExecute(cmd, output, errors);
- wxLogStatus(_T("Command '%s' terminated with exit code %d."),
- cmd.c_str(), code);
+ wxLogStatus("Command \"%s\" terminated after %ldms; exit code %d.",
+ cmd, sw.Time(), code);
if ( code != -1 )
{