mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-25 10:10:52 +00:00
Command line options
This commit is contained in:
parent
7c6230d374
commit
d08d09b341
3 changed files with 53 additions and 5 deletions
|
@ -15,12 +15,47 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
#include "../mesh_utils/mesh_utils.h"
|
#include "../mesh_utils/mesh_utils.h"
|
||||||
|
|
||||||
|
#include <nel/misc/cmd_args.h>
|
||||||
|
#include <nel/misc/path.h>
|
||||||
|
|
||||||
|
int printHelp(const NLMISC::CCmdArgs &args)
|
||||||
|
{
|
||||||
|
printf("NeL Mesh Export\n");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
mesh_utils_placeholder();
|
NLMISC::CCmdArgs args;
|
||||||
return 0;
|
args.setArgs(argc, (const char **)argv);
|
||||||
|
|
||||||
|
if (args.getArgs().size() == 1
|
||||||
|
|| args.haveArg('h')
|
||||||
|
|| args.haveLongArg("help"))
|
||||||
|
return printHelp(args);
|
||||||
|
|
||||||
|
const NLMISC::CSString &filePath = args.getArgs().back();
|
||||||
|
if (!NLMISC::CFile::fileExists(filePath))
|
||||||
|
{
|
||||||
|
printHelp(args);
|
||||||
|
nlerror("File '%s' does not exist", filePath);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMeshUtilsSettings settings;
|
||||||
|
settings.SourceFilePath = filePath;
|
||||||
|
|
||||||
|
settings.DestinationDirectory = args.getArg('d');
|
||||||
|
if (settings.DestinationDirectory.empty())
|
||||||
|
settings.DestinationDirectory = args.getLongArg("dst");
|
||||||
|
if (settings.DestinationDirectory.empty())
|
||||||
|
settings.DestinationDirectory = filePath + "_export";
|
||||||
|
settings.DestinationDirectory += "/";
|
||||||
|
|
||||||
|
return exportScene(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of file */
|
/* end of file */
|
||||||
|
|
|
@ -15,9 +15,12 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
void mesh_utils_placeholder()
|
#include <nel/misc/types_nl.h>
|
||||||
{
|
#include "mesh_utils.h"
|
||||||
|
|
||||||
|
int exportScene(CMeshUtilsSettings &settings)
|
||||||
|
{
|
||||||
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of file */
|
/* end of file */
|
||||||
|
|
|
@ -15,6 +15,16 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
void mesh_utils_placeholder();
|
#include <nel/misc/types_nl.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
struct CMeshUtilsSettings
|
||||||
|
{
|
||||||
|
std::string SourceFilePath;
|
||||||
|
std::string DestinationDirectory;
|
||||||
|
};
|
||||||
|
|
||||||
|
int exportScene(CMeshUtilsSettings &settings);
|
||||||
|
|
||||||
/* end of file */
|
/* end of file */
|
||||||
|
|
Loading…
Reference in a new issue