2015-11-09 19:02:38 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file commandoptions.cpp
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 9 11, 2015
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2015-11-09 19:02:38 +01:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2015-11-09 19:02:38 +01:00
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "commandoptions.h"
|
2022-02-18 09:36:38 +01:00
|
|
|
#include "literals.h"
|
2015-11-09 19:02:38 +01:00
|
|
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_BASENAME = QStringLiteral("basename");
|
|
|
|
const QString SINGLE_OPTION_BASENAME = QStringLiteral("b");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_DESTINATION = QStringLiteral("destination");
|
|
|
|
const QString SINGLE_OPTION_DESTINATION = QStringLiteral("d");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_MEASUREFILE = QStringLiteral("mfile");
|
|
|
|
const QString SINGLE_OPTION_MEASUREFILE = QStringLiteral("m");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_PAGETEMPLATE = QStringLiteral("pageformat");
|
|
|
|
const QString SINGLE_OPTION_PAGETEMPLATE = QStringLiteral("p");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_EXP2FORMAT = QStringLiteral("format");
|
|
|
|
const QString SINGLE_OPTION_EXP2FORMAT = QStringLiteral("f");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_BINARYDXF = QStringLiteral("bdxf");
|
|
|
|
const QString LONG_OPTION_NOGRAINLINE = QStringLiteral("noGrainline"); // NOLINT
|
|
|
|
const QString LONG_OPTION_TEXT2PATHS = QStringLiteral("text2paths");
|
2017-07-09 13:45:49 +02:00
|
|
|
const QString LONG_OPTION_EXPORTONLYDETAILS = QStringLiteral("exportOnlyDetails");
|
2017-09-22 18:16:16 +02:00
|
|
|
const QString LONG_OPTION_EXPORTSUCHDETAILS = QStringLiteral("exportSuchDetails");
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_EXPXSCALE = QStringLiteral("xscale");
|
|
|
|
const QString LONG_OPTION_EXPYSCALE = QStringLiteral("yscale");
|
2017-06-26 16:28:41 +02:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_CROP_LENGTH = QStringLiteral("crop");
|
|
|
|
const QString SINGLE_OPTION_CROP_LENGTH = QStringLiteral("c");
|
2019-10-16 10:16:16 +02:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_CROP_WIDTH = QStringLiteral("cropWidth");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_UNITE = QStringLiteral("unite");
|
|
|
|
const QString SINGLE_OPTION_UNITE = QStringLiteral("u");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_PAGEW = QStringLiteral("pagew");
|
|
|
|
const QString SINGLE_OPTION_PAGEW = QStringLiteral("W");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_PAGEH = QStringLiteral("pageh");
|
|
|
|
const QString SINGLE_OPTION_PAGEH = QStringLiteral("H");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_PAGEUNITS = QStringLiteral("pageunits");
|
|
|
|
const QString SINGLE_OPTION_PAGEUNITS = QStringLiteral("U");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_SAVELENGTH = QStringLiteral("savelen");
|
|
|
|
const QString SINGLE_OPTION_SAVELENGTH = QStringLiteral("S");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_SHIFTUNITS = QStringLiteral("layounits");
|
|
|
|
const QString SINGLE_OPTION_SHIFTUNITS = QStringLiteral("l");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_GAPWIDTH = QStringLiteral("gapwidth");
|
|
|
|
const QString SINGLE_OPTION_GAPWIDTH = QStringLiteral("G");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_GROUPPING = QStringLiteral("groups");
|
|
|
|
const QString SINGLE_OPTION_GROUPPING = QStringLiteral("g");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_TEST = QStringLiteral("test");
|
|
|
|
const QString SINGLE_OPTION_TEST = QStringLiteral("t");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_PENDANTIC = QStringLiteral("pedantic");
|
2018-07-13 15:18:04 +02:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_DIMENSION_A = QStringLiteral("dimensionA");
|
|
|
|
const QString LONG_OPTION_DIMENSION_B = QStringLiteral("dimensionB");
|
|
|
|
const QString LONG_OPTION_DIMENSION_C = QStringLiteral("dimensionC");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_USER_MATERIAL = QStringLiteral("userMaterial");
|
2018-07-18 19:18:30 +02:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_IGNORE_MARGINS = QStringLiteral("ignoremargins");
|
|
|
|
const QString SINGLE_OPTION_IGNORE_MARGINS = QStringLiteral("i");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_LEFT_MARGIN = QStringLiteral("lmargin");
|
|
|
|
const QString SINGLE_OPTION_LEFT_MARGIN = QStringLiteral("L");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_RIGHT_MARGIN = QStringLiteral("rmargin");
|
|
|
|
const QString SINGLE_OPTION_RIGHT_MARGIN = QStringLiteral("R");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_TOP_MARGIN = QStringLiteral("tmargin");
|
|
|
|
const QString SINGLE_OPTION_TOP_MARGIN = QStringLiteral("T");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_BOTTOM_MARGIN = QStringLiteral("bmargin");
|
|
|
|
const QString SINGLE_OPTION_BOTTOM_MARGIN = QStringLiteral("B");
|
2015-11-09 19:02:38 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_NESTING_TIME = QStringLiteral("time");
|
|
|
|
const QString SINGLE_OPTION_NESTING_TIME = QStringLiteral("n");
|
2019-03-29 10:31:17 +01:00
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_EFFICIENCY_COEFFICIENT = QStringLiteral("coefficient");
|
2019-03-29 10:31:17 +01:00
|
|
|
|
2017-09-28 15:05:04 +02:00
|
|
|
const QString LONG_OPTION_CSVWITHHEADER = QStringLiteral("csvWithHeader");
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_CSVCODEC = QStringLiteral("csvCodec");
|
|
|
|
const QString LONG_OPTION_CSVSEPARATOR = QStringLiteral("csvSeparator");
|
|
|
|
const QString LONG_OPTION_CSVEXPORTFM = QStringLiteral("csvExportFM");
|
2017-09-28 15:05:04 +02:00
|
|
|
|
2017-10-13 16:48:20 +02:00
|
|
|
const QString LONG_OPTION_TILED_PDF_PAGE_TEMPLATE = QStringLiteral("tiledPageformat");
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_TILED_PDF_LEFT_MARGIN = QStringLiteral("tiledlmargin");
|
|
|
|
const QString LONG_OPTION_TILED_PDF_RIGHT_MARGIN = QStringLiteral("tiledrmargin");
|
|
|
|
const QString LONG_OPTION_TILED_PDF_TOP_MARGIN = QStringLiteral("tiledtmargin");
|
2017-10-13 16:48:20 +02:00
|
|
|
const QString LONG_OPTION_TILED_PDF_BOTTOM_MARGIN = QStringLiteral("tiledbmargin");
|
2023-07-24 12:41:42 +02:00
|
|
|
const QString LONG_OPTION_TILED_PDF_LANDSCAPE = QStringLiteral("tiledLandscape");
|
2017-10-13 16:48:20 +02:00
|
|
|
|
2018-12-27 14:54:29 +01:00
|
|
|
const QString LONG_OPTION_FOLLOW_GRAINLINE = QStringLiteral("followGrainline");
|
2019-07-21 15:26:21 +02:00
|
|
|
const QString LONG_OPTION_MANUAL_PRIORITY = QStringLiteral("manualPriority");
|
2018-12-27 14:54:29 +01:00
|
|
|
|
2018-12-27 15:37:47 +01:00
|
|
|
const QString LONG_OPTION_LANDSCAPE_ORIENTATION = QStringLiteral("landscapeOrientation");
|
|
|
|
|
2019-07-04 13:33:45 +02:00
|
|
|
const QString LONG_OPTION_NEST_QUANTITY = QStringLiteral("nestQuantity");
|
2020-03-22 15:22:03 +01:00
|
|
|
const QString LONG_OPTION_PREFER_ONE_SHEET_SOLUTION = QStringLiteral("preferOneSheetSolution");
|
2019-07-04 13:33:45 +02:00
|
|
|
|
2015-11-09 19:02:38 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2018-07-18 19:18:30 +02:00
|
|
|
/**
|
|
|
|
* @brief AllKeys return list with all command line keys (short and long forms). Used for testing on conflicts.
|
|
|
|
* @return list with all command line keys
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
auto AllKeys() -> QStringList
|
2015-11-09 19:02:38 +01:00
|
|
|
{
|
2023-07-24 12:41:42 +02:00
|
|
|
return QStringList{LONG_OPTION_BASENAME,
|
|
|
|
SINGLE_OPTION_BASENAME,
|
|
|
|
LONG_OPTION_DESTINATION,
|
|
|
|
SINGLE_OPTION_DESTINATION,
|
|
|
|
LONG_OPTION_MEASUREFILE,
|
|
|
|
SINGLE_OPTION_MEASUREFILE,
|
|
|
|
LONG_OPTION_PAGETEMPLATE,
|
|
|
|
SINGLE_OPTION_PAGETEMPLATE,
|
|
|
|
LONG_OPTION_EXP2FORMAT,
|
|
|
|
SINGLE_OPTION_EXP2FORMAT,
|
|
|
|
LONG_OPTION_BINARYDXF,
|
|
|
|
LONG_OPTION_NOGRAINLINE,
|
|
|
|
LONG_OPTION_TEXT2PATHS,
|
|
|
|
LONG_OPTION_EXPORTONLYDETAILS,
|
|
|
|
LONG_OPTION_EXPORTSUCHDETAILS,
|
|
|
|
LONG_OPTION_EXPXSCALE,
|
|
|
|
LONG_OPTION_EXPYSCALE,
|
|
|
|
LONG_OPTION_CROP_LENGTH,
|
|
|
|
SINGLE_OPTION_CROP_LENGTH,
|
|
|
|
LONG_OPTION_CROP_WIDTH,
|
|
|
|
LONG_OPTION_UNITE,
|
|
|
|
SINGLE_OPTION_UNITE,
|
|
|
|
LONG_OPTION_PAGEW,
|
|
|
|
SINGLE_OPTION_PAGEW,
|
|
|
|
LONG_OPTION_PAGEH,
|
|
|
|
SINGLE_OPTION_PAGEH,
|
|
|
|
LONG_OPTION_PAGEUNITS,
|
|
|
|
SINGLE_OPTION_PAGEUNITS,
|
|
|
|
LONG_OPTION_SAVELENGTH,
|
|
|
|
SINGLE_OPTION_SAVELENGTH,
|
|
|
|
LONG_OPTION_SHIFTUNITS,
|
|
|
|
SINGLE_OPTION_SHIFTUNITS,
|
|
|
|
LONG_OPTION_GAPWIDTH,
|
|
|
|
SINGLE_OPTION_GAPWIDTH,
|
|
|
|
LONG_OPTION_GROUPPING,
|
|
|
|
SINGLE_OPTION_GROUPPING,
|
|
|
|
LONG_OPTION_TEST,
|
|
|
|
SINGLE_OPTION_TEST,
|
|
|
|
LONG_OPTION_PENDANTIC,
|
|
|
|
LONG_OPTION_DIMENSION_A,
|
|
|
|
LONG_OPTION_DIMENSION_B,
|
|
|
|
LONG_OPTION_DIMENSION_C,
|
|
|
|
LONG_OPTION_USER_MATERIAL,
|
|
|
|
LONG_OPTION_IGNORE_MARGINS,
|
|
|
|
SINGLE_OPTION_IGNORE_MARGINS,
|
|
|
|
LONG_OPTION_LEFT_MARGIN,
|
|
|
|
SINGLE_OPTION_LEFT_MARGIN,
|
|
|
|
LONG_OPTION_RIGHT_MARGIN,
|
|
|
|
SINGLE_OPTION_RIGHT_MARGIN,
|
|
|
|
LONG_OPTION_TOP_MARGIN,
|
|
|
|
SINGLE_OPTION_TOP_MARGIN,
|
|
|
|
LONG_OPTION_BOTTOM_MARGIN,
|
|
|
|
SINGLE_OPTION_BOTTOM_MARGIN,
|
|
|
|
LONG_OPTION_NESTING_TIME,
|
|
|
|
SINGLE_OPTION_NESTING_TIME,
|
|
|
|
LONG_OPTION_EFFICIENCY_COEFFICIENT,
|
|
|
|
LONG_OPTION_NO_HDPI_SCALING,
|
|
|
|
LONG_OPTION_CSVWITHHEADER,
|
|
|
|
LONG_OPTION_CSVCODEC,
|
|
|
|
LONG_OPTION_CSVSEPARATOR,
|
|
|
|
LONG_OPTION_CSVEXPORTFM,
|
|
|
|
LONG_OPTION_TILED_PDF_PAGE_TEMPLATE,
|
|
|
|
LONG_OPTION_TILED_PDF_LEFT_MARGIN,
|
|
|
|
LONG_OPTION_TILED_PDF_RIGHT_MARGIN,
|
|
|
|
LONG_OPTION_TILED_PDF_TOP_MARGIN,
|
|
|
|
LONG_OPTION_TILED_PDF_BOTTOM_MARGIN,
|
|
|
|
LONG_OPTION_TILED_PDF_LANDSCAPE,
|
|
|
|
LONG_OPTION_FOLLOW_GRAINLINE,
|
|
|
|
LONG_OPTION_MANUAL_PRIORITY,
|
|
|
|
LONG_OPTION_LANDSCAPE_ORIENTATION,
|
|
|
|
LONG_OPTION_NEST_QUANTITY,
|
2023-08-09 14:46:02 +02:00
|
|
|
LONG_OPTION_PREFER_ONE_SHEET_SOLUTION};
|
2015-11-09 19:02:38 +01:00
|
|
|
}
|