Skip to content

Commit

Permalink
Merge branch 'NatronGitHub:RB-2.6' into AJC-RB-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
acolwell committed Aug 1, 2024
2 parents f7d36d7 + f63b74d commit 88e8973
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
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

0 comments on commit 88e8973

Please sign in to comment.