Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Natron and NatronRenderer exit code. #993

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions App/NatronApp_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ int main(int argc, char *argv[])
CLArgs::printBackGroundWelcomeMessage();
CLArgs args(argc, argv, false);

if (args.getError() > 0) {
return 1;
const auto error = args.getError();
if (error) {
return error.value();
}

if ( args.isBackgroundMode() ) {
Expand Down
9 changes: 4 additions & 5 deletions Engine/CLArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct CLArgsPrivate
bool clearCacheOnLaunch;
bool clearOpenFXCacheOnLaunch;
QString ipcPipe;
int error;
std::optional<int> error;
bool isInterpreterMode;
std::list<std::pair<int, std::pair<int, int> > > frameRanges;
bool rangeSet;
Expand Down Expand Up @@ -95,7 +95,6 @@ struct CLArgsPrivate
, clearCacheOnLaunch(false)
, clearOpenFXCacheOnLaunch(false)
, ipcPipe()
, error(0)
, isInterpreterMode(false)
, frameRanges()
, rangeSet(false)
Expand Down Expand Up @@ -441,7 +440,7 @@ CLArgs::printUsage(const std::string& programName)
std::cout << msg.toStdString() << std::endl;
} // CLArgs::printUsage

int
const std::optional<int>&
CLArgs::getError() const
{
return _imp->error;
Expand Down Expand Up @@ -791,7 +790,7 @@ CLArgsPrivate::parse()
msg += tr(" built on %1").arg( QString::fromUtf8(__DATE__) );
# endif
std::cout << msg.toStdString() << std::endl;
error = 1;
error = 0;

return;
}
Expand All @@ -803,7 +802,7 @@ CLArgsPrivate::parse()
it = args.erase(it);

CLArgs::printUsage( executable.toStdString() );
error = 1;
error = 0;

return;
}
Expand Down
3 changes: 2 additions & 1 deletion Engine/CLArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "Global/Macros.h"

#include <list>
#include <optional>
#include <string>
#include <vector>
#include <utility>
Expand Down Expand Up @@ -99,7 +100,7 @@ class CLArgs //: boost::noncopyable // GCC 4.2 requires the copy constructor
static void printBackGroundWelcomeMessage();
static void printUsage(const std::string& programName);

int getError() const;
const std::optional<int>& getError() const;

const std::list<CLArgs::WriterArg>& getWriterArgs() const;
const std::list<CLArgs::ReaderArg>& getReaderArgs() const;
Expand Down
5 changes: 3 additions & 2 deletions Renderer/NatronRenderer_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ extern "C" {

CLArgs args(argc, argv, true);

if (args.getError() > 0) {
return 1;
const auto error = args.getError();
if (error) {
return error.value();
}

AppManager manager;
Expand Down