Print usage information before exit

This commit is contained in:
Kenneth Heafield 2012-10-05 17:49:52 +01:00
parent 01e661939e
commit 483e6b666b
2 changed files with 8 additions and 0 deletions

View File

@ -58,6 +58,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "ChartTrellisPath.h"
#include "ChartTrellisPathList.h"
#include "util/usage.hh"
using namespace std;
using namespace Moses;
using namespace MosesChartCmd;
@ -284,6 +286,8 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
IFVERBOSE(1) util::PrintUsage(std::cerr);
#ifdef HACK_EXIT
//This avoids that detructors are called (it can take a long time)
exit(EXIT_SUCCESS);

View File

@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <sstream>
#include <vector>
#include "util/usage.hh"
#ifdef WIN32
// Include Visual Leak Detector
//#include <vld.h>
@ -542,6 +544,8 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}
IFVERBOSE(1) util::PrintUsage(std::cerr);
#ifndef EXIT_RETURN
//This avoids that destructors are called (it can take a long time)
exit(EXIT_SUCCESS);