Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFormerLurker <hochgebe@gmail.com>2021-11-24 03:38:55 +0300
committerFormerLurker <hochgebe@gmail.com>2021-11-24 03:38:55 +0300
commit274b33a225485571a012471e997738e437607fcc (patch)
treedaeefcb0e521feca19465727b2359e42953bdadb
parent499c995652b829e42097ea88f93faf2c9c0aeaa5 (diff)
Allow Travel Arcs is now false by default, else it didn't make any sense as a flag. Enhance command line processing in the inverse processor. Update TCLAP library.
-rw-r--r--ArcWelder/arc_welder.h2
-rw-r--r--ArcWelderConsole/ArcWelderConsole.cpp36
-rw-r--r--ArcWelderInverseProcessor/ArcWelderInverseProcessor.cpp214
-rw-r--r--ArcWelderInverseProcessor/ArcWelderInverseProcessor.h4
-rw-r--r--ArcWelderInverseProcessor/firmware.h3
-rw-r--r--TCLAP/TCLAP.vcxproj2
-rw-r--r--TCLAP/TCLAP.vcxproj.filters2
-rw-r--r--TCLAP/tclap/AUTHORS6
-rw-r--r--TCLAP/tclap/Arg.h16
-rw-r--r--TCLAP/tclap/ArgException.h13
-rw-r--r--TCLAP/tclap/ArgTraits.h44
-rw-r--r--TCLAP/tclap/COPYING27
-rw-r--r--TCLAP/tclap/CmdLine.h34
-rw-r--r--TCLAP/tclap/CmdLineInterface.h5
-rw-r--r--TCLAP/tclap/CmdLineOutput.h3
-rw-r--r--TCLAP/tclap/Constraint.h10
-rw-r--r--TCLAP/tclap/DocBookOutput.h7
-rw-r--r--TCLAP/tclap/HelpVisitor.h2
-rw-r--r--TCLAP/tclap/IgnoreRestVisitor.h2
-rw-r--r--TCLAP/tclap/Makefile.am29
-rw-r--r--TCLAP/tclap/Makefile.in556
-rw-r--r--TCLAP/tclap/MultiArg.h18
-rw-r--r--TCLAP/tclap/MultiSwitchArg.h9
-rw-r--r--TCLAP/tclap/OptionalUnlabeledTracker.h2
-rw-r--r--TCLAP/tclap/StandardTraits.h153
-rw-r--r--TCLAP/tclap/StdOutput.h1
-rw-r--r--TCLAP/tclap/SwitchArg.h379
-rw-r--r--TCLAP/tclap/UnlabeledMultiArg.h3
-rw-r--r--TCLAP/tclap/UnlabeledValueArg.h3
-rw-r--r--TCLAP/tclap/ValueArg.h573
-rw-r--r--TCLAP/tclap/ValuesConstraint.h15
-rw-r--r--TCLAP/tclap/Visitor.h8
-rw-r--r--TCLAP/tclap/XorHandler.h14
-rw-r--r--TCLAP/tclap/ZshCompletionOutput.h5
-rw-r--r--readme.md158
35 files changed, 1602 insertions, 756 deletions
diff --git a/ArcWelder/arc_welder.h b/ArcWelder/arc_welder.h
index ca80217..ec07e7d 100644
--- a/ArcWelder/arc_welder.h
+++ b/ArcWelder/arc_welder.h
@@ -563,7 +563,7 @@ typedef bool(*progress_callback)(arc_welder_progress, logger* p_logger, int logg
#define DEFAULT_GCODE_BUFFER_SIZE 10
#define DEFAULT_G90_G91_INFLUENCES_EXTRUDER false
#define DEFAULT_ALLOW_DYNAMIC_PRECISION false
-#define DEFAULT_ALLOW_TRAVEL_ARCS true
+#define DEFAULT_ALLOW_TRAVEL_ARCS false
#define DEFAULT_EXTRUSION_RATE_VARIANCE_PERCENT 0.05
#define DEFAULT_NOTIFICATION_PERIOD_SECONDS 0.5
diff --git a/ArcWelderConsole/ArcWelderConsole.cpp b/ArcWelderConsole/ArcWelderConsole.cpp
index 12b965a..a9245ad 100644
--- a/ArcWelderConsole/ArcWelderConsole.cpp
+++ b/ArcWelderConsole/ArcWelderConsole.cpp
@@ -74,6 +74,12 @@ int main(int argc, char* argv[])
// <TARGET>
TCLAP::UnlabeledValueArg<std::string> target_arg("target", "The target gcode file containing the converted code. If this is not supplied, the source path will be used and the source file will be overwritten.", false, "", "path to target gcode file");
+ // -g --g90-influences-extruder
+ arg_description_stream.clear();
+ arg_description_stream.str("");
+ arg_description_stream << "If supplied, G90/G91 influences the extruder axis. Default Value: " << DEFAULT_G90_G91_INFLUENCES_EXTRUDER;
+ TCLAP::SwitchArg g90_arg("g", "g90-influences-extruder", arg_description_stream.str(), DEFAULT_G90_G91_INFLUENCES_EXTRUDER);
+
// -r --resolution-mm
arg_description_stream << "The resolution in mm of the of the output. Determines the maximum tool path deviation allowed during conversion. Default Value: " << DEFAULT_RESOLUTION_MM;
TCLAP::ValueArg<double> resolution_arg("r", "resolution-mm", arg_description_stream.str(), false, DEFAULT_RESOLUTION_MM, "float");
@@ -91,24 +97,6 @@ int main(int argc, char* argv[])
arg_description_stream << "The maximum radius of any arc in mm. Default Value: " << DEFAULT_MAX_RADIUS_MM;
TCLAP::ValueArg<double> max_radius_arg("m", "max-radius-mm", arg_description_stream.str(), false, DEFAULT_MAX_RADIUS_MM, "float");
- // -s --mm-per-arc-segment
- arg_description_stream.clear();
- arg_description_stream.str("");
- arg_description_stream << "The mm per arc segment as defined in your firmware. Used to compensate for firmware without min-arc-segments setting. Requires that min-arc-segments be set. Default Value: " << DEFAULT_MM_PER_ARC_SEGMENT;
- TCLAP::ValueArg<double> mm_per_arc_segment_arg("s", "mm-per-arc-segment", arg_description_stream.str(), false, DEFAULT_MM_PER_ARC_SEGMENT, "float");
-
- // -a --min-arc-segments
- arg_description_stream.clear();
- arg_description_stream.str("");
- arg_description_stream << "The minimum number of segments in a full circle of the same radius as any given arc. Can only be used if --mm-per-arc-segment is also set. Used to compensate for firmware without min-arc-segments setting. Default: " << DEFAULT_MIN_ARC_SEGMENTS;
- TCLAP::ValueArg<int> min_arc_segments_arg("a", "min-arc-segments", arg_description_stream.str(), false, DEFAULT_MIN_ARC_SEGMENTS, "int");
-
- // -g --g90-influences-extruder
- arg_description_stream.clear();
- arg_description_stream.str("");
- arg_description_stream << "If supplied, G90/G91 influences the extruder axis. Default Value: " << DEFAULT_G90_G91_INFLUENCES_EXTRUDER;
- TCLAP::SwitchArg g90_arg("g", "g90-influences-extruder", arg_description_stream.str(), DEFAULT_G90_G91_INFLUENCES_EXTRUDER);
-
// -z --allow-3d-arcs
arg_description_stream.clear();
arg_description_stream.str("");
@@ -139,6 +127,18 @@ int main(int argc, char* argv[])
arg_description_stream << "The default precision of E output gcode parameters. The precision may be larger than this value if allow-dynamic-precision is set to true. Default Value: " << DEFAULT_E_PRECISION;
TCLAP::ValueArg<unsigned int> default_e_precision_arg("e", "default-e-precision", arg_description_stream.str(), false, DEFAULT_E_PRECISION, "unsigned int");
+ // -s --mm-per-arc-segment
+ arg_description_stream.clear();
+ arg_description_stream.str("");
+ arg_description_stream << "The mm per arc segment as defined in your firmware. Used to compensate for firmware without min-arc-segments setting. Requires that min-arc-segments be set. Default Value: " << DEFAULT_MM_PER_ARC_SEGMENT;
+ TCLAP::ValueArg<double> mm_per_arc_segment_arg("s", "mm-per-arc-segment", arg_description_stream.str(), false, DEFAULT_MM_PER_ARC_SEGMENT, "float");
+
+ // -a --min-arc-segments
+ arg_description_stream.clear();
+ arg_description_stream.str("");
+ arg_description_stream << "The minimum number of segments in a full circle of the same radius as any given arc. Can only be used if --mm-per-arc-segment is also set. Used to compensate for firmware without min-arc-segments setting. Default: " << DEFAULT_MIN_ARC_SEGMENTS;
+ TCLAP::ValueArg<int> min_arc_segments_arg("a", "min-arc-segments", arg_description_stream.str(), false, DEFAULT_MIN_ARC_SEGMENTS, "int");
+
// -v --extrusion-rate-variance
arg_description_stream.clear();
arg_description_stream.str("");
diff --git a/ArcWelderInverseProcessor/ArcWelderInverseProcessor.cpp b/ArcWelderInverseProcessor/ArcWelderInverseProcessor.cpp
index d48beda..f3d35c3 100644
--- a/ArcWelderInverseProcessor/ArcWelderInverseProcessor.cpp
+++ b/ArcWelderInverseProcessor/ArcWelderInverseProcessor.cpp
@@ -87,8 +87,9 @@ int run_arc_straightener(int argc, char* argv[])
try {
// Define the command line object
TCLAP::CmdLine cmd(info, '=', GIT_TAGGED_VERSION);
+ // Define a special command line object for various help requests
+ TCLAP::CmdLine help_cmd(info, '=', GIT_TAGGED_VERSION, false);
- // Define Arguments
// <SOURCE>
TCLAP::UnlabeledValueArg<std::string> source_arg("source", "The source gcode file to convert.", true, "", "path to source gcode file");
@@ -120,6 +121,12 @@ int run_arc_straightener(int argc, char* argv[])
arg_description_stream << "\tDefault Value: " << DEFAULT_FIRMWARE_VERSION_NAME;
TCLAP::ValueArg<std::string> firmware_version_arg("v", "firmware-version", arg_description_stream.str(), false, DEFAULT_FIRMWARE_VERSION_NAME, "string");
+ // -p --print-firmware-defaults
+ arg_description_stream.clear();
+ arg_description_stream.str("");
+ arg_description_stream << "Prints all available settings and defaults for the provided firmware type and version. If provided, all other parameters will be ignored except for " << firmware_type_arg.getName() << " and " << firmware_version_arg.getName() << ".";
+ TCLAP::SwitchArg print_firmware_defaults_arg("p", "print-firmware-defaults", arg_description_stream.str());
+
// -g --g90-influences-extruder
std::string g90_g91_influences_extruder_default_value = "DEFAULT";
std::vector<std::string> g90_g91_influences_extruder_vector;
@@ -139,7 +146,7 @@ int run_arc_straightener(int argc, char* argv[])
TCLAP::ValueArg<double> mm_per_arc_segment_arg("m", "mm-per-arc-segment", arg_description_stream.str(), false, DEFAULT_MM_PER_ARC_SEGMENT, "float");
// max_arc_segment_mm_arg
- // -d --mm-per-arc-segment
+ // -d --max-arc-segment-mm
arg_description_stream.clear();
arg_description_stream.str("");
arg_description_stream << "The maximum length of an arc segment. Default Value: " << DEFAULT_MM_PER_ARC_SEGMENT;
@@ -169,7 +176,7 @@ int run_arc_straightener(int argc, char* argv[])
arg_description_stream.clear();
arg_description_stream.str("");
arg_description_stream << "The minimum number of segments within a circle of the same radius as the arc. Can be used to increase detail on small arcs. The smallest segment generated will be no larger than min_mm_per_arc_segment. A value less than or equal to 0 will disable this feature. Default Value: " << DEFAULT_MIN_ARC_SEGMENTS;
- TCLAP::ValueArg<int> min_circle_segments_arg("a", "min-circle-segments", arg_description_stream.str(), false, DEFAULT_MIN_ARC_SEGMENTS, "int");
+ TCLAP::ValueArg<int> min_circle_segments_arg("a", "min-circle-segments", arg_description_stream.str(), false, DEFAULT_MIN_CIRCLE_SEGMENTS, "int");
// -c --n-arc-correction
arg_description_stream.clear();
@@ -189,12 +196,6 @@ int run_arc_straightener(int argc, char* argv[])
arg_description_stream << "This currently is only used in Smoothieware. The maximum error for line segments that divide arcs. Set to 0 to disable. Default Value: " << DEFAULT_MM_MAX_ARC_ERROR;
TCLAP::ValueArg<double> mm_max_arc_error_arg("e", "mm-max-arc-error", arg_description_stream.str(), false, DEFAULT_MM_MAX_ARC_ERROR, "float");
- // -p --print-firmware-defaults
- arg_description_stream.clear();
- arg_description_stream.str("");
- arg_description_stream << "Prints all available settings and defaults for the provided firmware type and version. All other parameters will be ignored.";
- TCLAP::SwitchArg print_firmware_defaults_arg("p", "print-firmware-defaults", arg_description_stream.str());
-
// -l --log-level
std::vector<std::string> log_levels_vector;
log_levels_vector.push_back("NOSET");
@@ -228,55 +229,49 @@ int run_arc_straightener(int argc, char* argv[])
cmd.add(max_arc_segment_mm_arg);
cmd.add(print_firmware_defaults_arg);
- // Parse the argv array.
+ // First, we need to see if the user wants to print firmware defaults
+ help_cmd.add(firmware_type_arg);
+ help_cmd.add(firmware_version_arg);
+ help_cmd.add(print_firmware_defaults_arg);
+ help_cmd.setExceptionHandling(false);
+ // parse the help requests
+ try {
+ help_cmd.parse(argc, argv);
+
+ if (print_firmware_defaults_arg.isSet())
+ {
+ std::string firmware_type_string = firmware_type_arg.getValue();
+ std::string firmware_version_string = firmware_version_arg.getValue();
+ print_firmware_defaults(firmware_type_string, firmware_version_string, firmware_version_arg.getName());
+ return 0;
+ }
+ }
+ catch (TCLAP::ArgException& exc)
+ {
+ if (exc.argId() == "Argument: " + firmware_type_arg.toString()
+ || exc.argId() == "Argument: " + firmware_version_arg.toString())
+ {
+ // This will raise an exit exception
+ cmd.getOutput()->failure(cmd, exc);
+ }
+ }
+
+ // End print firmware defaults
+
+ // Parse the argv array after resetting any used parameters.
+ firmware_type_arg.reset();
+ firmware_version_arg.reset();
cmd.parse(argc, argv);
// Ok! Now let's see what firmware and version were selected, then we can start adding parameters
// First, Set the firmware type
std::string firmware_type_string = firmware_type_arg.getValue();
- for (int i = 0; i < NUM_FIRMWARE_TYPES; i++)
- {
- if (firmware_type_names[i] == firmware_type_string)
- {
- args.firmware_args.firmware_type = static_cast<firmware_types>(i);
- }
- }
+ firmware_types firmware_type = static_cast<firmware_types>(get_firmware_type_from_string(firmware_type_string));
+
// Now set the version
// Set the firmware version, and check to make sure that the version supplied is supported.
std::string firmware_version_string = firmware_version_arg.getValue();
- switch (args.firmware_args.firmware_type)
- {
- case firmware_types::MARLIN_1:
- if (!marlin_1_firmware.is_valid_version(firmware_version_string))
- {
- throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg.getName(), "'" + firmware_version_string + "' is not a valid version for " + firmware_type_string + " firmware type.");
- }
- break;
- case firmware_types::MARLIN_2:
- if (!marlin_2_firmware.is_valid_version(firmware_version_string))
- {
- throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg.getName(), "'" + firmware_version_string + "' is not a valid version for " + firmware_type_string + " firmware type.");
- }
- break;
- case firmware_types::REPETIER:
- if (!repetier_firmware.is_valid_version(firmware_version_string))
- {
- throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg.getName(), "'" + firmware_version_string + "' is not a valid version for " + firmware_type_string + " firmware type.");
- }
- break;
- case firmware_types::PRUSA:
- if (!prusa_firmware.is_valid_version(firmware_version_string))
- {
- throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg.getName(), "'" + firmware_version_string + "' is not a valid version for " + firmware_type_string + " firmware type.");
- }
- break;
- case firmware_types::SMOOTHIEWARE:
- if (!smoothieware_firmware.is_valid_version(firmware_version_string))
- {
- throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg.getName(), "'" + firmware_version_string + "' is not a valid version for " + firmware_type_string + " firmware type.");
- }
- break;
- }
+ is_firmware_version_valid_for_type(firmware_type_string, firmware_version_string, firmware_version_arg.getName());
args.firmware_args.version = firmware_version_string;
// now that we have the firmware type and version, we can extract the default arguments and override any settings that are supplied
@@ -304,13 +299,16 @@ int run_arc_straightener(int argc, char* argv[])
break;
}
- // see if the user want's to see the default settings
- if (print_firmware_defaults_arg.getValue())
+
+
+ // See if the source parameter is included
+ bool isSourceIncluded = source_arg.isSet();
+
+ // if the source parameter isn't set, we have to complain
+ if (!isSourceIncluded)
{
- std::cout << "Showing arguments and defaults for " << firmware_type_string << " ("<< firmware_version_string << ")\n";
- std::cout << "Available argument for firmware: " << get_available_arguments_string(args.firmware_args.get_available_arguments()) << "\n";
- std::cout << "Default " << args.firmware_args.get_argument_description();
- return 0;
+ std::cout << "The <source> parameter is required. Please specify a file to convert.";
+ return 0;
}
// Get the value parsed by each arg.
args.source_path = source_arg.getValue();
@@ -539,4 +537,108 @@ std::string get_available_arguments_string(std::vector<std::string> firmware_arg
available_argument_string += "--" +utilities::replace(*it, "_", "-");
}
return available_argument_string;
+}
+
+int get_firmware_type_from_string(std::string firmware_type)
+{
+ for (int i = 0; i < NUM_FIRMWARE_TYPES; i++)
+ {
+ if (firmware_type_names[i] == firmware_type)
+ {
+ return i;
+ }
+ }
+ // We should never get here if we properly limited the argument values
+ return static_cast<firmware_types>(DEFAULT_FIRMWARE_TYPE);
+}
+
+bool is_firmware_version_valid_for_type(std::string firmware_type_string, std::string firmware_version, std::string firmware_version_arg_name)
+{
+ firmware_types firmware_type = static_cast<firmware_types>(get_firmware_type_from_string(firmware_type_string));
+ // Create an instance of all supported firmware types using the default args
+ arc_interpolation_args args;
+ marlin_1 marlin_1_firmware(args.firmware_args);
+ marlin_2 marlin_2_firmware(args.firmware_args);
+ repetier repetier_firmware(args.firmware_args);
+ prusa prusa_firmware(args.firmware_args);
+ smoothieware smoothieware_firmware(args.firmware_args);
+
+ switch (firmware_type)
+ {
+ case firmware_types::MARLIN_1:
+ if (!marlin_1_firmware.is_valid_version(firmware_version))
+ {
+ throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg_name, "'" + firmware_version + "' is not a valid version for " + firmware_type_string + " firmware type.");
+ }
+ break;
+ case firmware_types::MARLIN_2:
+ if (!marlin_2_firmware.is_valid_version(firmware_version))
+ {
+ throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg_name, "'" + firmware_version + "' is not a valid version for " + firmware_type_string + " firmware type.");
+ }
+ break;
+ case firmware_types::REPETIER:
+ if (!repetier_firmware.is_valid_version(firmware_version))
+ {
+ throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg_name, "'" + firmware_version + "' is not a valid version for " + firmware_type_string + " firmware type.");
+ }
+ break;
+ case firmware_types::PRUSA:
+ if (!prusa_firmware.is_valid_version(firmware_version))
+ {
+ throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg_name, "'" + firmware_version + "' is not a valid version for " + firmware_type_string + " firmware type.");
+ }
+ break;
+ case firmware_types::SMOOTHIEWARE:
+ if (!smoothieware_firmware.is_valid_version(firmware_version))
+ {
+ throw new TCLAP::ArgException("Unknown Version Exception", firmware_version_arg_name, "'" + firmware_version + "' is not a valid version for " + firmware_type_string + " firmware type.");
+ }
+ break;
+ }
+}
+
+void print_firmware_defaults(std::string firmware_type_string, std::string firmware_version_string, std::string firmware_version_arg_name)
+{
+ arc_interpolation_args args;
+ marlin_1 marlin_1_firmware(args.firmware_args);
+ marlin_2 marlin_2_firmware(args.firmware_args);
+ repetier repetier_firmware(args.firmware_args);
+ prusa prusa_firmware(args.firmware_args);
+ smoothieware smoothieware_firmware(args.firmware_args);
+
+
+ firmware_types firmware_type = static_cast<firmware_types>(get_firmware_type_from_string(firmware_type_string));
+ args.firmware_args.firmware_type = firmware_type;
+ is_firmware_version_valid_for_type(firmware_type_string, firmware_version_string, firmware_version_arg_name);
+ args.firmware_args.version = firmware_version_string;
+
+ // now that we have the firmware type and version, we can extract the default arguments and override any settings that are supplied
+ switch (args.firmware_args.firmware_type)
+ {
+ case firmware_types::MARLIN_1:
+ marlin_1_firmware.set_arguments(args.firmware_args);
+ args.firmware_args = marlin_1_firmware.get_default_arguments_for_current_version();
+ break;
+ case firmware_types::MARLIN_2:
+ marlin_2_firmware.set_arguments(args.firmware_args);
+ args.firmware_args = marlin_2_firmware.get_default_arguments_for_current_version();
+ break;
+ case firmware_types::REPETIER:
+ repetier_firmware.set_arguments(args.firmware_args);
+ args.firmware_args = repetier_firmware.get_default_arguments_for_current_version();
+ break;
+ case firmware_types::PRUSA:
+ prusa_firmware.set_arguments(args.firmware_args);
+ args.firmware_args = prusa_firmware.get_default_arguments_for_current_version();
+ break;
+ case firmware_types::SMOOTHIEWARE:
+ smoothieware_firmware.set_arguments(args.firmware_args);
+ args.firmware_args = smoothieware_firmware.get_default_arguments_for_current_version();
+ break;
+ }
+
+ std::cout << "Showing arguments and defaults for " << firmware_type_string << " (" << firmware_version_string << ")\n";
+ std::cout << "Available argument for firmware: " << get_available_arguments_string(args.firmware_args.get_available_arguments()) << "\n";
+ std::cout << "Default " << args.firmware_args.get_argument_description();
} \ No newline at end of file
diff --git a/ArcWelderInverseProcessor/ArcWelderInverseProcessor.h b/ArcWelderInverseProcessor/ArcWelderInverseProcessor.h
index b6e8c2b..0b2ca1a 100644
--- a/ArcWelderInverseProcessor/ArcWelderInverseProcessor.h
+++ b/ArcWelderInverseProcessor/ArcWelderInverseProcessor.h
@@ -36,6 +36,10 @@
#include <vector>
int run_arc_straightener(int argc, char* argv[]);
static std::string get_available_arguments_string(std::vector<std::string> firmware_arguments);
+static bool is_firmware_version_valid_for_type(std::string firmware_type_string, std::string firmware_version, std::string firmware_version_arg_name);
+static int get_firmware_type_from_string(std::string firmware_type);
+static void print_firmware_defaults(std::string firmware_type_string, std::string firmware_version_string, std::string firmware_version_arg_name);
+
/*
static void TestInverseProcessor(std::string source_path, std::string target_path);
static std::string ANTI_STUTTER_TEST = "C:\\Users\\Brad\\Documents\\3DPrinter\\AntiStutter\\5x5_cylinder_2000Fn_0.2mm_PLA_MK2.5MMU2_4m.gcode";
diff --git a/ArcWelderInverseProcessor/firmware.h b/ArcWelderInverseProcessor/firmware.h
index 86ceadf..d2f7f2d 100644
--- a/ArcWelderInverseProcessor/firmware.h
+++ b/ArcWelderInverseProcessor/firmware.h
@@ -47,7 +47,8 @@
#define DEFAULT_MIN_MM_PER_ARC_SEGMENT 0 /* OPTIONAL - the enforced minimum length of an interpolated segment. Must be smaller than
MM_PER_ARC_SEGMENT. Only has an effect if MIN_ARC_SEGMENTS > 0 or ARC_SEGMENTS_PER_SEC > 0 */
// If both MIN_ARC_SEGMENTS and ARC_SEGMENTS_PER_SEC is defined, the minimum calculated segment length is used.
-#define DEFAULT_MIN_ARC_SEGMENTS 0 // OPTIONAL - The enforced minimum segments in a full circle of the same radius.
+#define DEFAULT_MIN_ARC_SEGMENTS 24 // OPTIONAL - The enforced minimum segments in a full circle of the same radius.
+#define DEFAULT_MIN_CIRCLE_SEGMENTS 72 // OPTIONAL - The enforced minimum segments in a full circle of the same radius.
#define DEFAULT_ARC_SEGMENTS_PER_SEC 0 // OPTIONAL - Use feedrate to choose segment length.
// approximation will not be used for the first segment. Subsequent segments will be corrected following DEFAULT_N_ARC_CORRECTION.
#define DEFAULT_N_ARC_CORRECTIONS 24
diff --git a/TCLAP/TCLAP.vcxproj b/TCLAP/TCLAP.vcxproj
index 6527598..6b577ac 100644
--- a/TCLAP/TCLAP.vcxproj
+++ b/TCLAP/TCLAP.vcxproj
@@ -195,6 +195,8 @@
</ItemDefinitionGroup>
<ItemGroup>
<None Include="COPYING" />
+ <None Include="tclap\AUTHORS" />
+ <None Include="tclap\COPYING" />
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
diff --git a/TCLAP/TCLAP.vcxproj.filters b/TCLAP/TCLAP.vcxproj.filters
index 0441038..3b2bed8 100644
--- a/TCLAP/TCLAP.vcxproj.filters
+++ b/TCLAP/TCLAP.vcxproj.filters
@@ -16,6 +16,8 @@
</ItemGroup>
<ItemGroup>
<None Include="COPYING" />
+ <None Include="tclap\AUTHORS" />
+ <None Include="tclap\COPYING" />
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
diff --git a/TCLAP/tclap/AUTHORS b/TCLAP/tclap/AUTHORS
new file mode 100644
index 0000000..9a291f1
--- /dev/null
+++ b/TCLAP/tclap/AUTHORS
@@ -0,0 +1,6 @@
+
+original author: Michael E. Smoot
+current maintainer: Daniel Aarno
+more contributions: Erik Zeek
+more contributions: Fabien Carmagnac (Tinbergen-AM)
+outstanding editing: Carol Smoot
diff --git a/TCLAP/tclap/Arg.h b/TCLAP/tclap/Arg.h
index 3ad3e77..f8c4a5f 100644
--- a/TCLAP/tclap/Arg.h
+++ b/TCLAP/tclap/Arg.h
@@ -39,16 +39,6 @@
#include <tclap/sstream.h>
-#if defined(HAVE_SSTREAM)
-#include <sstream>
-typedef std::istringstream istringstream;
-#elif defined(HAVE_STRSTREAM)
-#include <strstream>
-typedef std::istrstream istringstream;
-#else
-#error "Need a stringstream (sstream or strstream) to compile!"
-#endif
-
#include <tclap/ArgException.h>
#include <tclap/Visitor.h>
#include <tclap/CmdLineInterface.h>
@@ -394,17 +384,17 @@ class Arg
/**
* Typedef of an Arg list iterator.
*/
-typedef std::list<Arg*>::iterator ArgListIterator;
+typedef std::list<Arg*>::const_iterator ArgListIterator;
/**
* Typedef of an Arg vector iterator.
*/
-typedef std::vector<Arg*>::iterator ArgVectorIterator;
+typedef std::vector<Arg*>::const_iterator ArgVectorIterator;
/**
* Typedef of a Visitor list iterator.
*/
-typedef std::list<Visitor*>::iterator VisitorListIterator;
+typedef std::list<Visitor*>::const_iterator VisitorListIterator;
/*
* Extract a value of type T from it's string representation contained
diff --git a/TCLAP/tclap/ArgException.h b/TCLAP/tclap/ArgException.h
index f789d1c..1e0f659 100644
--- a/TCLAP/tclap/ArgException.h
+++ b/TCLAP/tclap/ArgException.h
@@ -5,6 +5,7 @@
* file: ArgException.h
*
* Copyright (c) 2003, Michael E. Smoot .
+ * Copyright (c) 2017 Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -184,6 +185,18 @@ class SpecificationException : public ArgException
};
+/**
+ * Thrown when TCLAP thinks the program should exit.
+ *
+ * For example after parse error this exception will be thrown (and
+ * normally caught). This allows any resource to be clened properly
+ * before exit.
+ *
+ * If exception handling is disabled (CmdLine::setExceptionHandling),
+ * this exception will propagate to the call site, allowing the
+ * program to catch it and avoid program termination, or do it's own
+ * cleanup. See for example, https://sourceforge.net/p/tclap/bugs/29.
+ */
class ExitException {
public:
ExitException(int estat) : _estat(estat) {}
diff --git a/TCLAP/tclap/ArgTraits.h b/TCLAP/tclap/ArgTraits.h
index 7ae85a9..0ccf5e3 100644
--- a/TCLAP/tclap/ArgTraits.h
+++ b/TCLAP/tclap/ArgTraits.h
@@ -5,6 +5,7 @@
* file: ArgTraits.h
*
* Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
+ * Copyright (c) 2017 Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -73,13 +74,46 @@ struct ValueLikeTrait {
* Arg traits are used to get compile type specialization when parsing
* argument values. Using an ArgTraits you can specify the way that
* values gets assigned to any particular type during parsing. The two
- * supported types are StringLike and ValueLike.
+ * supported types are StringLike and ValueLike. ValueLike is the
+ * default and means that operator>> will be used to assign values to
+ * the type.
*/
template<typename T>
-struct ArgTraits {
- typedef typename T::ValueCategory ValueCategory;
- virtual ~ArgTraits() {}
- //typedef ValueLike ValueCategory;
+class ArgTraits {
+ // This is a bit silly, but what we want to do is:
+ // 1) If there exists a specialization of ArgTraits for type X,
+ // use it.
+ //
+ // 2) If no specialization exists but X has the typename
+ // X::ValueCategory, use the specialization for X::ValueCategory.
+ //
+ // 3) If neither (1) nor (2) defines the trait, use the default
+ // which is ValueLike.
+
+ // This is the "how":
+ //
+ // test<T>(0) (where 0 is the NULL ptr) will match
+ // test(typename C::ValueCategory*) iff type T has the
+ // corresponding typedef. If it does not test(...) will be
+ // matched. This allows us to determine if T::ValueCategory
+ // exists by checking the sizeof for the test function (return
+ // value must have different sizeof).
+ template<typename C> static short test(typename C::ValueCategory*);
+ template<typename C> static long test(...);
+ static const bool hasTrait = sizeof(test<T>(0)) == sizeof(short);
+
+ template <typename C, bool>
+ struct DefaultArgTrait {
+ typedef ValueLike ValueCategory;
+ };
+
+ template <typename C>
+ struct DefaultArgTrait<C, true> {
+ typedef typename C::ValueCategory ValueCategory;
+ };
+
+public:
+ typedef typename DefaultArgTrait<T, hasTrait>::ValueCategory ValueCategory;
};
} // namespace
diff --git a/TCLAP/tclap/COPYING b/TCLAP/tclap/COPYING
new file mode 100644
index 0000000..d573236
--- /dev/null
+++ b/TCLAP/tclap/COPYING
@@ -0,0 +1,27 @@
+
+
+Copyright (c) 2003 Michael E. Smoot
+Copyright (c) 2004 Daniel Aarno
+Copyright (c) 2017 Google Inc.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
diff --git a/TCLAP/tclap/CmdLine.h b/TCLAP/tclap/CmdLine.h
index c91e656..dc49bae 100644
--- a/TCLAP/tclap/CmdLine.h
+++ b/TCLAP/tclap/CmdLine.h
@@ -183,6 +183,11 @@ private:
*/
bool _helpAndVersion;
+ /**
+ * Whether or not to ignore unmatched args.
+ */
+ bool _ignoreUnmatched;
+
public:
/**
@@ -232,7 +237,7 @@ private:
* add does not need to be called.
* \param xors - List of Args to be added and xor'd.
*/
- void xorAdd( std::vector<Arg*>& xors );
+ void xorAdd( const std::vector<Arg*>& xors );
/**
* Parses the command line.
@@ -313,6 +318,13 @@ private:
*/
void reset();
+ /**
+ * Allows unmatched args to be ignored. By default false.
+ *
+ * @param ignore If true the cmdline will ignore any unmatched args
+ * and if false it will behave as normal.
+ */
+ void ignoreUnmatched(const bool ignore);
};
@@ -337,7 +349,8 @@ inline CmdLine::CmdLine(const std::string& m,
_output(0),
_handleExceptions(true),
_userSetOutput(false),
- _helpAndVersion(help)
+ _helpAndVersion(help),
+ _ignoreUnmatched(false)
{
_constructor();
}
@@ -390,7 +403,7 @@ inline void CmdLine::_constructor()
deleteOnExit(v);
}
-inline void CmdLine::xorAdd( std::vector<Arg*>& ors )
+inline void CmdLine::xorAdd( const std::vector<Arg*>& ors )
{
_xorHandler.add( ors );
@@ -445,8 +458,14 @@ inline void CmdLine::parse(std::vector<std::string>& args)
{
bool shouldExit = false;
int estat = 0;
-
try {
+ if (args.empty()) {
+ // https://sourceforge.net/p/tclap/bugs/30/
+ throw CmdLineParseException("The args vector must not be empty, "
+ "the first entry should contain the "
+ "program's name.");
+ }
+
_progName = args.front();
args.erase(args.begin());
@@ -470,7 +489,7 @@ inline void CmdLine::parse(std::vector<std::string>& args)
if ( !matched && _emptyCombined( args[i] ) )
matched = true;
- if ( !matched && !Arg::ignoreRest() )
+ if ( !matched && !Arg::ignoreRest() && !_ignoreUnmatched)
throw(CmdLineParseException("Couldn't find match "
"for argument",
args[i]));
@@ -623,6 +642,11 @@ inline void CmdLine::reset()
_progName.clear();
}
+inline void CmdLine::ignoreUnmatched(const bool ignore)
+{
+ _ignoreUnmatched = ignore;
+}
+
///////////////////////////////////////////////////////////////////////////////
//End CmdLine.cpp
///////////////////////////////////////////////////////////////////////////////
diff --git a/TCLAP/tclap/CmdLineInterface.h b/TCLAP/tclap/CmdLineInterface.h
index cf60f34..a9bdca0 100644
--- a/TCLAP/tclap/CmdLineInterface.h
+++ b/TCLAP/tclap/CmdLineInterface.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
@@ -5,6 +7,7 @@
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -75,7 +78,7 @@ class CmdLineInterface
* add does not need to be called.
* \param xors - List of Args to be added and xor'd.
*/
- virtual void xorAdd( std::vector<Arg*>& xors )=0;
+ virtual void xorAdd( const std::vector<Arg*>& xors )=0;
/**
* Parses the command line.
diff --git a/TCLAP/tclap/CmdLineOutput.h b/TCLAP/tclap/CmdLineOutput.h
index 11b8939..cbc9a32 100644
--- a/TCLAP/tclap/CmdLineOutput.h
+++ b/TCLAP/tclap/CmdLineOutput.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
@@ -5,6 +7,7 @@
* file: CmdLineOutput.h
*
* Copyright (c) 2004, Michael E. Smoot
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
diff --git a/TCLAP/tclap/Constraint.h b/TCLAP/tclap/Constraint.h
index 21dc06f..ff869cc 100644
--- a/TCLAP/tclap/Constraint.h
+++ b/TCLAP/tclap/Constraint.h
@@ -1,9 +1,12 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
* file: Constraint.h
*
* Copyright (c) 2005, Michael E. Smoot
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -28,6 +31,7 @@
#include <iostream>
#include <iomanip>
#include <algorithm>
+#include <stdexcept>
namespace TCLAP {
@@ -62,6 +66,12 @@ class Constraint
* functions but without a virtual destructor.
*/
virtual ~Constraint() { ; }
+
+ static std::string shortID(Constraint<T> *constraint) {
+ if (!constraint)
+ throw std::logic_error("Cannot create a ValueArg with a NULL constraint");
+ return constraint->shortID();
+ }
};
} //namespace TCLAP
diff --git a/TCLAP/tclap/DocBookOutput.h b/TCLAP/tclap/DocBookOutput.h
index f023824..80b10e5 100644
--- a/TCLAP/tclap/DocBookOutput.h
+++ b/TCLAP/tclap/DocBookOutput.h
@@ -5,6 +5,7 @@
* file: DocBookOutput.h
*
* Copyright (c) 2004, Michael E. Smoot
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -100,7 +101,7 @@ inline void DocBookOutput::usage(CmdLineInterface& _cmd )
std::string xversion = _cmd.getVersion();
theDelimiter = _cmd.getDelimiter();
XorHandler xorHandler = _cmd.getXorHandler();
- std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
+ const std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
basename(progName);
std::cout << "<?xml version='1.0'?>" << std::endl;
@@ -134,7 +135,7 @@ inline void DocBookOutput::usage(CmdLineInterface& _cmd )
std::cout << "</group>" << std::endl;
}
-
+
// rest of args
for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
if ( !xorHandler.contains( (*it) ) )
@@ -242,6 +243,7 @@ inline void DocBookOutput::printShortArg(Arg* a)
removeChar(arg,']');
removeChar(arg,'<');
removeChar(arg,'>');
+ removeChar(arg,'.');
arg.erase(0, arg.find_last_of(theDelimiter) + 1);
std::cout << theDelimiter;
std::cout << "<replaceable>" << arg << "</replaceable>";
@@ -280,6 +282,7 @@ inline void DocBookOutput::printLongArg(Arg* a)
removeChar(arg,']');
removeChar(arg,'<');
removeChar(arg,'>');
+ removeChar(arg,'.');
arg.erase(0, arg.find_last_of(theDelimiter) + 1);
std::cout << theDelimiter;
std::cout << "<replaceable>" << arg << "</replaceable>";
diff --git a/TCLAP/tclap/HelpVisitor.h b/TCLAP/tclap/HelpVisitor.h
index ee09144..5ee3756 100644
--- a/TCLAP/tclap/HelpVisitor.h
+++ b/TCLAP/tclap/HelpVisitor.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
diff --git a/TCLAP/tclap/IgnoreRestVisitor.h b/TCLAP/tclap/IgnoreRestVisitor.h
index d20f6e0..1824c3c 100644
--- a/TCLAP/tclap/IgnoreRestVisitor.h
+++ b/TCLAP/tclap/IgnoreRestVisitor.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
diff --git a/TCLAP/tclap/Makefile.am b/TCLAP/tclap/Makefile.am
new file mode 100644
index 0000000..5424fdf
--- /dev/null
+++ b/TCLAP/tclap/Makefile.am
@@ -0,0 +1,29 @@
+
+libtclapincludedir = $(includedir)/tclap
+
+libtclapinclude_HEADERS = \
+ Arg.h \
+ ArgException.h \
+ ArgTraits.h \
+ CmdLine.h \
+ CmdLineInterface.h \
+ CmdLineOutput.h \
+ Constraint.h \
+ DocBookOutput.h \
+ HelpVisitor.h \
+ IgnoreRestVisitor.h \
+ MultiArg.h \
+ MultiSwitchArg.h \
+ OptionalUnlabeledTracker.h \
+ StandardTraits.h \
+ StdOutput.h \
+ SwitchArg.h \
+ UnlabeledMultiArg.h \
+ UnlabeledValueArg.h \
+ ValueArg.h \
+ ValuesConstraint.h \
+ VersionVisitor.h \
+ Visitor.h \
+ XorHandler.h \
+ ZshCompletionOutput.h \
+ sstream.h
diff --git a/TCLAP/tclap/Makefile.in b/TCLAP/tclap/Makefile.in
new file mode 100644
index 0000000..e84d5f4
--- /dev/null
+++ b/TCLAP/tclap/Makefile.in
@@ -0,0 +1,556 @@
+# Makefile.in generated by automake 1.16.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = include/tclap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \
+ $(top_srcdir)/config/ac_cxx_have_sstream.m4 \
+ $(top_srcdir)/config/ac_cxx_have_strstream.m4 \
+ $(top_srcdir)/config/ac_cxx_namespaces.m4 \
+ $(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \
+ $(top_srcdir)/config/bb_enable_doxygen.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(libtclapinclude_HEADERS) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(libtclapincludedir)"
+HEADERS = $(libtclapinclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/config/mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOT = @DOT@
+DOXYGEN = @DOXYGEN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@
+WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+libtclapincludedir = $(includedir)/tclap
+libtclapinclude_HEADERS = \
+ Arg.h \
+ ArgException.h \
+ ArgTraits.h \
+ CmdLine.h \
+ CmdLineInterface.h \
+ CmdLineOutput.h \
+ Constraint.h \
+ DocBookOutput.h \
+ HelpVisitor.h \
+ IgnoreRestVisitor.h \
+ MultiArg.h \
+ MultiSwitchArg.h \
+ OptionalUnlabeledTracker.h \
+ StandardTraits.h \
+ StdOutput.h \
+ SwitchArg.h \
+ UnlabeledMultiArg.h \
+ UnlabeledValueArg.h \
+ ValueArg.h \
+ ValuesConstraint.h \
+ VersionVisitor.h \
+ Visitor.h \
+ XorHandler.h \
+ ZshCompletionOutput.h \
+ sstream.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/tclap/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu include/tclap/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libtclapincludeHEADERS: $(libtclapinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(libtclapinclude_HEADERS)'; test -n "$(libtclapincludedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libtclapincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libtclapincludedir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libtclapincludedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libtclapincludedir)" || exit $$?; \
+ done
+
+uninstall-libtclapincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libtclapinclude_HEADERS)'; test -n "$(libtclapincludedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libtclapincludedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(libtclapincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libtclapincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libtclapincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ cscopelist-am ctags ctags-am distclean distclean-generic \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libtclapincludeHEADERS install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-libtclapincludeHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/TCLAP/tclap/MultiArg.h b/TCLAP/tclap/MultiArg.h
index d478df9..e0df8b9 100644
--- a/TCLAP/tclap/MultiArg.h
+++ b/TCLAP/tclap/MultiArg.h
@@ -1,9 +1,12 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
* file: MultiArg.h
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -185,7 +188,7 @@ public:
* Returns a vector of type T containing the values parsed from
* the command line.
*/
- const std::vector<T>& getValue();
+ const std::vector<T>& getValue() const { return _values; }
/**
* Returns an iterator over the values parsed from the command
@@ -225,8 +228,8 @@ private:
/**
* Prevent accidental copying
*/
- MultiArg<T>(const MultiArg<T>& rhs);
- MultiArg<T>& operator=(const MultiArg<T>& rhs);
+ MultiArg(const MultiArg<T>& rhs);
+ MultiArg& operator=(const MultiArg<T>& rhs);
};
@@ -276,7 +279,7 @@ MultiArg<T>::MultiArg(const std::string& flag,
Visitor* v)
: Arg( flag, name, desc, req, true, v ),
_values(std::vector<T>()),
- _typeDesc( constraint->shortID() ),
+ _typeDesc( Constraint<T>::shortID(constraint) ),
_constraint( constraint ),
_allowMore(false)
{
@@ -293,7 +296,7 @@ MultiArg<T>::MultiArg(const std::string& flag,
Visitor* v)
: Arg( flag, name, desc, req, true, v ),
_values(std::vector<T>()),
- _typeDesc( constraint->shortID() ),
+ _typeDesc( Constraint<T>::shortID(constraint) ),
_constraint( constraint ),
_allowMore(false)
{
@@ -302,9 +305,6 @@ MultiArg<T>::MultiArg(const std::string& flag,
}
template<class T>
-const std::vector<T>& MultiArg<T>::getValue() { return _values; }
-
-template<class T>
bool MultiArg<T>::processArg(int *i, std::vector<std::string>& args)
{
if ( _ignoreable && Arg::ignoreRest() )
@@ -362,7 +362,7 @@ template<class T>
std::string MultiArg<T>::shortID(const std::string& val) const
{
static_cast<void>(val); // Ignore input, don't warn
- return Arg::shortID(_typeDesc) + " ... ";
+ return Arg::shortID(_typeDesc) + " ...";
}
/**
diff --git a/TCLAP/tclap/MultiSwitchArg.h b/TCLAP/tclap/MultiSwitchArg.h
index 208d998..e333ea7 100644
--- a/TCLAP/tclap/MultiSwitchArg.h
+++ b/TCLAP/tclap/MultiSwitchArg.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
@@ -6,6 +8,7 @@
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
* Copyright (c) 2005, Michael E. Smoot, Daniel Aarno, Erik Zeek.
+* Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -108,7 +111,7 @@ class MultiSwitchArg : public SwitchArg
/**
* Returns int, the number of times the switch has been set.
*/
- int getValue();
+ int getValue() const { return _value; }
/**
* Returns the shortID for this Arg.
@@ -150,8 +153,6 @@ _default( init )
parser.add( this );
}
-inline int MultiSwitchArg::getValue() { return _value; }
-
inline bool MultiSwitchArg::processArg(int *i, std::vector<std::string>& args)
{
if ( _ignoreable && Arg::ignoreRest() )
@@ -192,7 +193,7 @@ inline bool MultiSwitchArg::processArg(int *i, std::vector<std::string>& args)
inline std::string
MultiSwitchArg::shortID(const std::string& val) const
{
- return Arg::shortID(val) + " ... ";
+ return Arg::shortID(val) + " ...";
}
inline std::string
diff --git a/TCLAP/tclap/OptionalUnlabeledTracker.h b/TCLAP/tclap/OptionalUnlabeledTracker.h
index 92f8929..aa64116 100644
--- a/TCLAP/tclap/OptionalUnlabeledTracker.h
+++ b/TCLAP/tclap/OptionalUnlabeledTracker.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
diff --git a/TCLAP/tclap/StandardTraits.h b/TCLAP/tclap/StandardTraits.h
index 75c9c64..5864f77 100644
--- a/TCLAP/tclap/StandardTraits.h
+++ b/TCLAP/tclap/StandardTraits.h
@@ -5,6 +5,7 @@
* file: StandardTraits.h
*
* Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -41,156 +42,10 @@
namespace TCLAP {
-// ======================================================================
-// Integer types
-// ======================================================================
+// Integer types (signed, unsigned and bool) and floating point types all
+// have value-like semantics.
-/**
- * longs have value-like semantics.
- */
-template<>
-struct ArgTraits<long> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * ints have value-like semantics.
- */
-template<>
-struct ArgTraits<int> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * shorts have value-like semantics.
- */
-template<>
-struct ArgTraits<short> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * chars have value-like semantics.
- */
-template<>
-struct ArgTraits<char> {
- typedef ValueLike ValueCategory;
-};
-
-#ifdef HAVE_LONG_LONG
-/**
- * long longs have value-like semantics.
- */
-template<>
-struct ArgTraits<long long> {
- typedef ValueLike ValueCategory;
-};
-#endif
-
-// ======================================================================
-// Unsigned integer types
-// ======================================================================
-
-/**
- * unsigned longs have value-like semantics.
- */
-template<>
-struct ArgTraits<unsigned long> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * unsigned ints have value-like semantics.
- */
-template<>
-struct ArgTraits<unsigned int> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * unsigned shorts have value-like semantics.
- */
-template<>
-struct ArgTraits<unsigned short> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * unsigned chars have value-like semantics.
- */
-template<>
-struct ArgTraits<unsigned char> {
- typedef ValueLike ValueCategory;
-};
-
-// Microsoft implements size_t awkwardly.
-#if defined(_MSC_VER) && defined(_M_X64)
-/**
- * size_ts have value-like semantics.
- */
-template<>
-struct ArgTraits<size_t> {
- typedef ValueLike ValueCategory;
-};
-#endif
-
-
-#ifdef HAVE_LONG_LONG
-/**
- * unsigned long longs have value-like semantics.
- */
-template<>
-struct ArgTraits<unsigned long long> {
- typedef ValueLike ValueCategory;
-};
-#endif
-
-// ======================================================================
-// Float types
-// ======================================================================
-
-/**
- * floats have value-like semantics.
- */
-template<>
-struct ArgTraits<float> {
- typedef ValueLike ValueCategory;
-};
-
-/**
- * doubles have value-like semantics.
- */
-template<>
-struct ArgTraits<double> {
- typedef ValueLike ValueCategory;
-};
-
-// ======================================================================
-// Other types
-// ======================================================================
-
-/**
- * bools have value-like semantics.
- */
-template<>
-struct ArgTraits<bool> {
- typedef ValueLike ValueCategory;
-};
-
-
-/**
- * wchar_ts have value-like semantics.
- */
-#ifndef TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
-template<>
-struct ArgTraits<wchar_t> {
- typedef ValueLike ValueCategory;
-};
-#endif
-
-/**
- * Strings have string like argument traits.
- */
+// Strings have string like argument traits.
template<>
struct ArgTraits<std::string> {
typedef StringLike ValueCategory;
diff --git a/TCLAP/tclap/StdOutput.h b/TCLAP/tclap/StdOutput.h
index f224ea2..cfef79a 100644
--- a/TCLAP/tclap/StdOutput.h
+++ b/TCLAP/tclap/StdOutput.h
@@ -5,6 +5,7 @@
* file: StdOutput.h
*
* Copyright (c) 2004, Michael E. Smoot
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
diff --git a/TCLAP/tclap/SwitchArg.h b/TCLAP/tclap/SwitchArg.h
index c2e8395..4ca130d 100644
--- a/TCLAP/tclap/SwitchArg.h
+++ b/TCLAP/tclap/SwitchArg.h
@@ -1,3 +1,4 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
/******************************************************************************
*
@@ -5,20 +6,21 @@
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
* more information.
*
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- *****************************************************************************/
+ *****************************************************************************/
#ifndef TCLAP_SWITCH_ARG_H
@@ -38,224 +40,229 @@ namespace TCLAP {
*/
class SwitchArg : public Arg
{
- protected:
-
- /**
- * The value of the switch.
- */
- bool _value;
-
- /**
- * Used to support the reset() method so that ValueArg can be
- * reset to their constructed value.
- */
- bool _default;
-
- public:
-
- /**
- * SwitchArg constructor.
- * \param flag - The one character flag that identifies this
- * argument on the command line.
- * \param name - A one word name for the argument. Can be
- * used as a long flag on the command line.
- * \param desc - A description of what the argument is for or
- * does.
- * \param def - The default value for this Switch.
- * \param v - An optional visitor. You probably should not
- * use this unless you have a very good reason.
- */
- SwitchArg(const std::string& flag,
- const std::string& name,
- const std::string& desc,
- bool def = false,
- Visitor* v = NULL);
-
-
- /**
- * SwitchArg constructor.
- * \param flag - The one character flag that identifies this
- * argument on the command line.
- * \param name - A one word name for the argument. Can be
- * used as a long flag on the command line.
- * \param desc - A description of what the argument is for or
- * does.
- * \param parser - A CmdLine parser object to add this Arg to
- * \param def - The default value for this Switch.
- * \param v - An optional visitor. You probably should not
- * use this unless you have a very good reason.
- */
- SwitchArg(const std::string& flag,
- const std::string& name,
- const std::string& desc,
- CmdLineInterface& parser,
- bool def = false,
- Visitor* v = NULL);
-
-
- /**
- * Handles the processing of the argument.
- * This re-implements the Arg version of this method to set the
- * _value of the argument appropriately.
- * \param i - Pointer the the current argument in the list.
- * \param args - Mutable list of strings. Passed
- * in from main().
- */
- virtual bool processArg(int* i, std::vector<std::string>& args);
-
- /**
- * Checks a string to see if any of the chars in the string
- * match the flag for this Switch.
- */
- bool combinedSwitchesMatch(std::string& combined);
-
- /**
- * Returns bool, whether or not the switch has been set.
- */
- bool getValue();
-
- virtual void reset();
-
- private:
- /**
- * Checks to see if we've found the last match in
- * a combined string.
- */
- bool lastCombined(std::string& combined);
-
- /**
- * Does the common processing of processArg.
- */
- void commonProcessing();
+protected:
+
+ /**
+ * The value of the switch.
+ */
+ bool _value;
+
+ /**
+ * Used to support the reset() method so that ValueArg can be
+ * reset to their constructed value.
+ */
+ bool _default;
+
+public:
+
+ /**
+ * SwitchArg constructor.
+ * \param flag - The one character flag that identifies this
+ * argument on the command line.
+ * \param name - A one word name for the argument. Can be
+ * used as a long flag on the command line.
+ * \param desc - A description of what the argument is for or
+ * does.
+ * \param def - The default value for this Switch.
+ * \param v - An optional visitor. You probably should not
+ * use this unless you have a very good reason.
+ */
+ SwitchArg(const std::string& flag,
+ const std::string& name,
+ const std::string& desc,
+ bool def = false,
+ Visitor* v = NULL);
+
+
+ /**
+ * SwitchArg constructor.
+ * \param flag - The one character flag that identifies this
+ * argument on the command line.
+ * \param name - A one word name for the argument. Can be
+ * used as a long flag on the command line.
+ * \param desc - A description of what the argument is for or
+ * does.
+ * \param parser - A CmdLine parser object to add this Arg to
+ * \param def - The default value for this Switch.
+ * \param v - An optional visitor. You probably should not
+ * use this unless you have a very good reason.
+ */
+ SwitchArg(const std::string& flag,
+ const std::string& name,
+ const std::string& desc,
+ CmdLineInterface& parser,
+ bool def = false,
+ Visitor* v = NULL);
+
+
+ /**
+ * Handles the processing of the argument.
+ * This re-implements the Arg version of this method to set the
+ * _value of the argument appropriately.
+ * \param i - Pointer the the current argument in the list.
+ * \param args - Mutable list of strings. Passed
+ * in from main().
+ */
+ virtual bool processArg(int* i, std::vector<std::string>& args);
+
+ /**
+ * Checks a string to see if any of the chars in the string
+ * match the flag for this Switch.
+ */
+ bool combinedSwitchesMatch(std::string& combined);
+
+ /**
+ * Returns bool, whether or not the switch has been set.
+ */
+ bool getValue() const { return _value; }
+
+ /**
+ * A SwitchArg can be used as a boolean, indicating
+ * whether or not the switch has been set. This is the
+ * same as calling getValue()
+ */
+ operator bool() const { return _value; }
+
+ virtual void reset();
+
+private:
+ /**
+ * Checks to see if we've found the last match in
+ * a combined string.
+ */
+ bool lastCombined(std::string& combined);
+
+ /**
+ * Does the common processing of processArg.
+ */
+ void commonProcessing();
};
//////////////////////////////////////////////////////////////////////
//BEGIN SwitchArg.cpp
//////////////////////////////////////////////////////////////////////
inline SwitchArg::SwitchArg(const std::string& flag,
- const std::string& name,
- const std::string& desc,
- bool default_val,
- Visitor* v )
-: Arg(flag, name, desc, false, false, v),
- _value( default_val ),
- _default( default_val )
+ const std::string& name,
+ const std::string& desc,
+ bool default_val,
+ Visitor* v )
+ : Arg(flag, name, desc, false, false, v),
+ _value( default_val ),
+ _default( default_val )
{ }
inline SwitchArg::SwitchArg(const std::string& flag,
- const std::string& name,
- const std::string& desc,
- CmdLineInterface& parser,
- bool default_val,
- Visitor* v )
-: Arg(flag, name, desc, false, false, v),
- _value( default_val ),
- _default(default_val)
+ const std::string& name,
+ const std::string& desc,
+ CmdLineInterface& parser,
+ bool default_val,
+ Visitor* v )
+ : Arg(flag, name, desc, false, false, v),
+ _value( default_val ),
+ _default(default_val)
{
- parser.add( this );
+ parser.add( this );
}
-inline bool SwitchArg::getValue() { return _value; }
-
inline bool SwitchArg::lastCombined(std::string& combinedSwitches )
{
- for ( unsigned int i = 1; i < combinedSwitches.length(); i++ )
- if ( combinedSwitches[i] != Arg::blankChar() )
- return false;
-
- return true;
+ for ( unsigned int i = 1; i < combinedSwitches.length(); i++ )
+ if ( combinedSwitches[i] != Arg::blankChar() )
+ return false;
+
+ return true;
}
inline bool SwitchArg::combinedSwitchesMatch(std::string& combinedSwitches )
{
- // make sure this is actually a combined switch
- if ( combinedSwitches.length() > 0 &&
- combinedSwitches[0] != Arg::flagStartString()[0] )
- return false;
-
- // make sure it isn't a long name
- if ( combinedSwitches.substr( 0, Arg::nameStartString().length() ) ==
- Arg::nameStartString() )
- return false;
-
- // make sure the delimiter isn't in the string
- if ( combinedSwitches.find_first_of( Arg::delimiter() ) != std::string::npos )
- return false;
-
- // ok, we're not specifying a ValueArg, so we know that we have
- // a combined switch list.
- for ( unsigned int i = 1; i < combinedSwitches.length(); i++ )
- if ( _flag.length() > 0 &&
- combinedSwitches[i] == _flag[0] &&
- _flag[0] != Arg::flagStartString()[0] )
- {
- // update the combined switches so this one is no longer present
- // this is necessary so that no unlabeled args are matched
- // later in the processing.
- //combinedSwitches.erase(i,1);
- combinedSwitches[i] = Arg::blankChar();
- return true;
- }
-
- // none of the switches passed in the list match.
- return false;
+ // make sure this is actually a combined switch
+ if ( combinedSwitches.length() > 0 &&
+ combinedSwitches[0] != Arg::flagStartString()[0] )
+ return false;
+
+ // make sure it isn't a long name
+ if ( combinedSwitches.substr( 0, Arg::nameStartString().length() ) ==
+ Arg::nameStartString() )
+ return false;
+
+ // make sure the delimiter isn't in the string
+ if ( combinedSwitches.find_first_of(Arg::delimiter()) != std::string::npos)
+ return false;
+
+ // ok, we're not specifying a ValueArg, so we know that we have
+ // a combined switch list.
+ for ( unsigned int i = 1; i < combinedSwitches.length(); i++ )
+ if ( _flag.length() > 0 &&
+ combinedSwitches[i] == _flag[0] &&
+ _flag[0] != Arg::flagStartString()[0] )
+ {
+ // update the combined switches so this one is no longer present
+ // this is necessary so that no unlabeled args are matched
+ // later in the processing.
+ //combinedSwitches.erase(i,1);
+ combinedSwitches[i] = Arg::blankChar();
+ return true;
+ }
+
+ // none of the switches passed in the list match.
+ return false;
}
inline void SwitchArg::commonProcessing()
{
- if ( _xorSet )
- throw(CmdLineParseException(
- "Mutually exclusive argument already set!", toString()));
+ if ( _xorSet )
+ throw(CmdLineParseException(
+ "Mutually exclusive argument already set!", toString()));
- if ( _alreadySet )
- throw(CmdLineParseException("Argument already set!", toString()));
+ if ( _alreadySet )
+ throw(CmdLineParseException("Argument already set!", toString()));
- _alreadySet = true;
+ _alreadySet = true;
- if ( _value == true )
- _value = false;
- else
- _value = true;
+ if ( _value == true )
+ _value = false;
+ else
+ _value = true;
- _checkWithVisitor();
+ _checkWithVisitor();
}
inline bool SwitchArg::processArg(int *i, std::vector<std::string>& args)
{
- if ( _ignoreable && Arg::ignoreRest() )
- return false;
-
- // if the whole string matches the flag or name string
- if ( argMatches( args[*i] ) )
- {
- commonProcessing();
-
- return true;
- }
- // if a substring matches the flag as part of a combination
- else if ( combinedSwitchesMatch( args[*i] ) )
- {
- // check again to ensure we don't misinterpret
- // this as a MultiSwitchArg
- if ( combinedSwitchesMatch( args[*i] ) )
- throw(CmdLineParseException("Argument already set!",
- toString()));
-
- commonProcessing();
-
- // We only want to return true if we've found the last combined
- // match in the string, otherwise we return true so that other
- // switches in the combination will have a chance to match.
- return lastCombined( args[*i] );
- }
- else
- return false;
+ if ( _ignoreable && Arg::ignoreRest() )
+ return false;
+
+ // if the whole string matches the flag or name string
+ if ( argMatches( args[*i] ) )
+ {
+ commonProcessing();
+
+ return true;
+ }
+ // if a substring matches the flag as part of a combination
+ else if ( combinedSwitchesMatch( args[*i] ) )
+ {
+ // check again to ensure we don't misinterpret
+ // this as a MultiSwitchArg
+ if ( combinedSwitchesMatch( args[*i] ) )
+ throw(CmdLineParseException("Argument already set!",
+ toString()));
+
+ commonProcessing();
+
+ // We only want to return true if we've found the last combined
+ // match in the string, otherwise we return true so that other
+ // switches in the combination will have a chance to match.
+ return lastCombined( args[*i] );
+ }
+ else
+ return false;
}
inline void SwitchArg::reset()
{
- Arg::reset();
- _value = _default;
+ Arg::reset();
+ _value = _default;
}
//////////////////////////////////////////////////////////////////////
//End SwitchArg.cpp
diff --git a/TCLAP/tclap/UnlabeledMultiArg.h b/TCLAP/tclap/UnlabeledMultiArg.h
index 7995bc2..48feb84 100644
--- a/TCLAP/tclap/UnlabeledMultiArg.h
+++ b/TCLAP/tclap/UnlabeledMultiArg.h
@@ -1,9 +1,12 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
* file: UnlabeledMultiArg.h
*
* Copyright (c) 2003, Michael E. Smoot.
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
diff --git a/TCLAP/tclap/UnlabeledValueArg.h b/TCLAP/tclap/UnlabeledValueArg.h
index 25e85ff..341a3c0 100644
--- a/TCLAP/tclap/UnlabeledValueArg.h
+++ b/TCLAP/tclap/UnlabeledValueArg.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
@@ -5,6 +7,7 @@
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
diff --git a/TCLAP/tclap/ValueArg.h b/TCLAP/tclap/ValueArg.h
index 2f65e4c..791d93f 100644
--- a/TCLAP/tclap/ValueArg.h
+++ b/TCLAP/tclap/ValueArg.h
@@ -1,23 +1,26 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
* file: ValueArg.h
*
* Copyright (c) 2003, Michael E. Smoot .
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
* more information.
*
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- *****************************************************************************/
+ *****************************************************************************/
#ifndef TCLAP_VALUE_ARGUMENT_H
@@ -42,206 +45,216 @@ namespace TCLAP {
template<class T>
class ValueArg : public Arg
{
- protected:
-
- /**
- * The value parsed from the command line.
- * Can be of any type, as long as the >> operator for the type
- * is defined.
- */
- T _value;
-
- /**
- * Used to support the reset() method so that ValueArg can be
- * reset to their constructed value.
- */
- T _default;
-
- /**
- * A human readable description of the type to be parsed.
- * This is a hack, plain and simple. Ideally we would use RTTI to
- * return the name of type T, but until there is some sort of
- * consistent support for human readable names, we are left to our
- * own devices.
- */
- std::string _typeDesc;
-
- /**
- * A Constraint this Arg must conform to.
- */
- Constraint<T>* _constraint;
-
- /**
- * Extracts the value from the string.
- * Attempts to parse string as type T, if this fails an exception
- * is thrown.
- * \param val - value to be parsed.
- */
- void _extractValue( const std::string& val );
-
- public:
-
- /**
- * Labeled ValueArg constructor.
- * You could conceivably call this constructor with a blank flag,
- * but that would make you a bad person. It would also cause
- * an exception to be thrown. If you want an unlabeled argument,
- * use the other constructor.
- * \param flag - The one character flag that identifies this
- * argument on the command line.
- * \param name - A one word name for the argument. Can be
- * used as a long flag on the command line.
- * \param desc - A description of what the argument is for or
- * does.
- * \param req - Whether the argument is required on the command
- * line.
- * \param value - The default value assigned to this argument if it
- * is not present on the command line.
- * \param typeDesc - A short, human readable description of the
- * type that this object expects. This is used in the generation
- * of the USAGE statement. The goal is to be helpful to the end user
- * of the program.
- * \param v - An optional visitor. You probably should not
- * use this unless you have a very good reason.
- */
- ValueArg( const std::string& flag,
- const std::string& name,
- const std::string& desc,
- bool req,
- T value,
- const std::string& typeDesc,
- Visitor* v = NULL);
-
-
- /**
- * Labeled ValueArg constructor.
- * You could conceivably call this constructor with a blank flag,
- * but that would make you a bad person. It would also cause
- * an exception to be thrown. If you want an unlabeled argument,
- * use the other constructor.
- * \param flag - The one character flag that identifies this
- * argument on the command line.
- * \param name - A one word name for the argument. Can be
- * used as a long flag on the command line.
- * \param desc - A description of what the argument is for or
- * does.
- * \param req - Whether the argument is required on the command
- * line.
- * \param value - The default value assigned to this argument if it
- * is not present on the command line.
- * \param typeDesc - A short, human readable description of the
- * type that this object expects. This is used in the generation
- * of the USAGE statement. The goal is to be helpful to the end user
- * of the program.
- * \param parser - A CmdLine parser object to add this Arg to
- * \param v - An optional visitor. You probably should not
- * use this unless you have a very good reason.
- */
- ValueArg( const std::string& flag,
- const std::string& name,
- const std::string& desc,
- bool req,
- T value,
- const std::string& typeDesc,
- CmdLineInterface& parser,
- Visitor* v = NULL );
+protected:
+
+ /**
+ * The value parsed from the command line.
+ * Can be of any type, as long as the >> operator for the type
+ * is defined.
+ */
+ T _value;
+
+ /**
+ * Used to support the reset() method so that ValueArg can be
+ * reset to their constructed value.
+ */
+ T _default;
+
+ /**
+ * A human readable description of the type to be parsed.
+ * This is a hack, plain and simple. Ideally we would use RTTI to
+ * return the name of type T, but until there is some sort of
+ * consistent support for human readable names, we are left to our
+ * own devices.
+ */
+ std::string _typeDesc;
+
+ /**
+ * A Constraint this Arg must conform to.
+ */
+ Constraint<T>* _constraint;
+
+ /**
+ * Extracts the value from the string.
+ * Attempts to parse string as type T, if this fails an exception
+ * is thrown.
+ * \param val - value to be parsed.
+ */
+ void _extractValue( const std::string& val );
+
+public:
+
+ /**
+ * Labeled ValueArg constructor.
+ * You could conceivably call this constructor with a blank flag,
+ * but that would make you a bad person. It would also cause
+ * an exception to be thrown. If you want an unlabeled argument,
+ * use the other constructor.
+ * \param flag - The one character flag that identifies this
+ * argument on the command line.
+ * \param name - A one word name for the argument. Can be
+ * used as a long flag on the command line.
+ * \param desc - A description of what the argument is for or
+ * does.
+ * \param req - Whether the argument is required on the command
+ * line.
+ * \param value - The default value assigned to this argument if it
+ * is not present on the command line.
+ * \param typeDesc - A short, human readable description of the
+ * type that this object expects. This is used in the generation
+ * of the USAGE statement. The goal is to be helpful to the end user
+ * of the program.
+ * \param v - An optional visitor. You probably should not
+ * use this unless you have a very good reason.
+ */
+ ValueArg( const std::string& flag,
+ const std::string& name,
+ const std::string& desc,
+ bool req,
+ T value,
+ const std::string& typeDesc,
+ Visitor* v = NULL);
+
+
+ /**
+ * Labeled ValueArg constructor.
+ * You could conceivably call this constructor with a blank flag,
+ * but that would make you a bad person. It would also cause
+ * an exception to be thrown. If you want an unlabeled argument,
+ * use the other constructor.
+ * \param flag - The one character flag that identifies this
+ * argument on the command line.
+ * \param name - A one word name for the argument. Can be
+ * used as a long flag on the command line.
+ * \param desc - A description of what the argument is for or
+ * does.
+ * \param req - Whether the argument is required on the command
+ * line.
+ * \param value - The default value assigned to this argument if it
+ * is not present on the command line.
+ * \param typeDesc - A short, human readable description of the
+ * type that this object expects. This is used in the generation
+ * of the USAGE statement. The goal is to be helpful to the end user
+ * of the program.
+ * \param parser - A CmdLine parser object to add this Arg to
+ * \param v - An optional visitor. You probably should not
+ * use this unless you have a very good reason.
+ */
+ ValueArg( const std::string& flag,
+ const std::string& name,
+ const std::string& desc,
+ bool req,
+ T value,
+ const std::string& typeDesc,
+ CmdLineInterface& parser,
+ Visitor* v = NULL );
- /**
- * Labeled ValueArg constructor.
- * You could conceivably call this constructor with a blank flag,
- * but that would make you a bad person. It would also cause
- * an exception to be thrown. If you want an unlabeled argument,
- * use the other constructor.
- * \param flag - The one character flag that identifies this
- * argument on the command line.
- * \param name - A one word name for the argument. Can be
- * used as a long flag on the command line.
- * \param desc - A description of what the argument is for or
- * does.
- * \param req - Whether the argument is required on the command
- * line.
- * \param value - The default value assigned to this argument if it
- * is not present on the command line.
- * \param constraint - A pointer to a Constraint object used
- * to constrain this Arg.
- * \param parser - A CmdLine parser object to add this Arg to.
- * \param v - An optional visitor. You probably should not
- * use this unless you have a very good reason.
- */
- ValueArg( const std::string& flag,
- const std::string& name,
- const std::string& desc,
- bool req,
- T value,
- Constraint<T>* constraint,
- CmdLineInterface& parser,
- Visitor* v = NULL );
-
- /**
- * Labeled ValueArg constructor.
- * You could conceivably call this constructor with a blank flag,
- * but that would make you a bad person. It would also cause
- * an exception to be thrown. If you want an unlabeled argument,
- * use the other constructor.
- * \param flag - The one character flag that identifies this
- * argument on the command line.
- * \param name - A one word name for the argument. Can be
- * used as a long flag on the command line.
- * \param desc - A description of what the argument is for or
- * does.
- * \param req - Whether the argument is required on the command
- * line.
- * \param value - The default value assigned to this argument if it
- * is not present on the command line.
- * \param constraint - A pointer to a Constraint object used
- * to constrain this Arg.
- * \param v - An optional visitor. You probably should not
- * use this unless you have a very good reason.
- */
- ValueArg( const std::string& flag,
- const std::string& name,
- const std::string& desc,
- bool req,
- T value,
- Constraint<T>* constraint,
- Visitor* v = NULL );
-
- /**
- * Handles the processing of the argument.
- * This re-implements the Arg version of this method to set the
- * _value of the argument appropriately. It knows the difference
- * between labeled and unlabeled.
- * \param i - Pointer the the current argument in the list.
- * \param args - Mutable list of strings. Passed
- * in from main().
- */
- virtual bool processArg(int* i, std::vector<std::string>& args);
-
- /**
- * Returns the value of the argument.
- */
- T& getValue() ;
-
- /**
- * Specialization of shortID.
- * \param val - value to be used.
- */
- virtual std::string shortID(const std::string& val = "val") const;
-
- /**
- * Specialization of longID.
- * \param val - value to be used.
- */
- virtual std::string longID(const std::string& val = "val") const;
+ /**
+ * Labeled ValueArg constructor.
+ * You could conceivably call this constructor with a blank flag,
+ * but that would make you a bad person. It would also cause
+ * an exception to be thrown. If you want an unlabeled argument,
+ * use the other constructor.
+ * \param flag - The one character flag that identifies this
+ * argument on the command line.
+ * \param name - A one word name for the argument. Can be
+ * used as a long flag on the command line.
+ * \param desc - A description of what the argument is for or
+ * does.
+ * \param req - Whether the argument is required on the command
+ * line.
+ * \param value - The default value assigned to this argument if it
+ * is not present on the command line.
+ * \param constraint - A pointer to a Constraint object used
+ * to constrain this Arg.
+ * \param parser - A CmdLine parser object to add this Arg to.
+ * \param v - An optional visitor. You probably should not
+ * use this unless you have a very good reason.
+ */
+ ValueArg( const std::string& flag,
+ const std::string& name,
+ const std::string& desc,
+ bool req,
+ T value,
+ Constraint<T>* constraint,
+ CmdLineInterface& parser,
+ Visitor* v = NULL );
+
+ /**
+ * Labeled ValueArg constructor.
+ * You could conceivably call this constructor with a blank flag,
+ * but that would make you a bad person. It would also cause
+ * an exception to be thrown. If you want an unlabeled argument,
+ * use the other constructor.
+ * \param flag - The one character flag that identifies this
+ * argument on the command line.
+ * \param name - A one word name for the argument. Can be
+ * used as a long flag on the command line.
+ * \param desc - A description of what the argument is for or
+ * does.
+ * \param req - Whether the argument is required on the command
+ * line.
+ * \param value - The default value assigned to this argument if it
+ * is not present on the command line.
+ * \param constraint - A pointer to a Constraint object used
+ * to constrain this Arg.
+ * \param v - An optional visitor. You probably should not
+ * use this unless you have a very good reason.
+ */
+ ValueArg( const std::string& flag,
+ const std::string& name,
+ const std::string& desc,
+ bool req,
+ T value,
+ Constraint<T>* constraint,
+ Visitor* v = NULL );
+
+ /**
+ * Handles the processing of the argument.
+ * This re-implements the Arg version of this method to set the
+ * _value of the argument appropriately. It knows the difference
+ * between labeled and unlabeled.
+ * \param i - Pointer the the current argument in the list.
+ * \param args - Mutable list of strings. Passed
+ * in from main().
+ */
+ virtual bool processArg(int* i, std::vector<std::string>& args);
+
+ /**
+ * Returns the value of the argument.
+ */
+ const T& getValue() const { return _value; }
+
+ // TODO(macbishop): Non-const variant is deprecated, don't
+ // use. Remove in next major.
+ T& getValue() { return _value; }
+
+ /**
+ * A ValueArg can be used as as its value type (T) This is the
+ * same as calling getValue()
+ */
+ operator const T&() const { return getValue(); }
+
+ /**
+ * Specialization of shortID.
+ * \param val - value to be used.
+ */
+ virtual std::string shortID(const std::string& val = "val") const;
+
+ /**
+ * Specialization of longID.
+ * \param val - value to be used.
+ */
+ virtual std::string longID(const std::string& val = "val") const;
- virtual void reset() ;
+ virtual void reset() ;
private:
- /**
- * Prevent accidental copying
- */
- ValueArg<T>(const ValueArg<T>& rhs);
- ValueArg<T>& operator=(const ValueArg<T>& rhs);
+ /**
+ * Prevent accidental copying
+ */
+ ValueArg(const ValueArg<T>& rhs);
+ ValueArg& operator=(const ValueArg<T>& rhs);
};
@@ -256,11 +269,11 @@ ValueArg<T>::ValueArg(const std::string& flag,
T val,
const std::string& typeDesc,
Visitor* v)
-: Arg(flag, name, desc, req, true, v),
- _value( val ),
- _default( val ),
- _typeDesc( typeDesc ),
- _constraint( NULL )
+ : Arg(flag, name, desc, req, true, v),
+ _value( val ),
+ _default( val ),
+ _typeDesc( typeDesc ),
+ _constraint( NULL )
{ }
template<class T>
@@ -272,13 +285,13 @@ ValueArg<T>::ValueArg(const std::string& flag,
const std::string& typeDesc,
CmdLineInterface& parser,
Visitor* v)
-: Arg(flag, name, desc, req, true, v),
- _value( val ),
- _default( val ),
- _typeDesc( typeDesc ),
- _constraint( NULL )
+ : Arg(flag, name, desc, req, true, v),
+ _value( val ),
+ _default( val ),
+ _typeDesc( typeDesc ),
+ _constraint( NULL )
{
- parser.add( this );
+ parser.add( this );
}
template<class T>
@@ -289,11 +302,11 @@ ValueArg<T>::ValueArg(const std::string& flag,
T val,
Constraint<T>* constraint,
Visitor* v)
-: Arg(flag, name, desc, req, true, v),
- _value( val ),
- _default( val ),
- _typeDesc( constraint->shortID() ),
- _constraint( constraint )
+ : Arg(flag, name, desc, req, true, v),
+ _value( val ),
+ _default( val ),
+ _typeDesc( Constraint<T>::shortID(constraint) ),
+ _constraint( constraint )
{ }
template<class T>
@@ -305,75 +318,67 @@ ValueArg<T>::ValueArg(const std::string& flag,
Constraint<T>* constraint,
CmdLineInterface& parser,
Visitor* v)
-: Arg(flag, name, desc, req, true, v),
- _value( val ),
- _default( val ),
- _typeDesc( constraint->shortID() ),
- _constraint( constraint )
+ : Arg(flag, name, desc, req, true, v),
+ _value( val ),
+ _default( val ),
+ _typeDesc( Constraint<T>::shortID(constraint) ), // TODO(macbishop): Will crash
+ // if constraint is NULL
+ _constraint( constraint )
{
- parser.add( this );
+ parser.add( this );
}
-
-/**
- * Implementation of getValue().
- */
-template<class T>
-T& ValueArg<T>::getValue() { return _value; }
-
/**
* Implementation of processArg().
*/
template<class T>
bool ValueArg<T>::processArg(int *i, std::vector<std::string>& args)
{
- if ( _ignoreable && Arg::ignoreRest() )
- return false;
+ if ( _ignoreable && Arg::ignoreRest() )
+ return false;
- if ( _hasBlanks( args[*i] ) )
- return false;
+ if ( _hasBlanks( args[*i] ) )
+ return false;
- std::string flag = args[*i];
+ std::string flag = args[*i];
- std::string value = "";
- trimFlag( flag, value );
+ std::string value = "";
+ trimFlag( flag, value );
- if ( argMatches( flag ) )
+ if ( argMatches( flag ) )
{
- if ( _alreadySet )
- {
- if ( _xorSet )
- throw( CmdLineParseException(
- "Mutually exclusive argument already set!",
- toString()) );
- else
- throw( CmdLineParseException("Argument already set!",
- toString()) );
- }
-
- if ( Arg::delimiter() != ' ' && value == "" )
- throw( ArgParseException(
- "Couldn't find delimiter for this argument!",
- toString() ) );
-
- if ( value == "" )
+ if ( _alreadySet )
+ {
+ if ( _xorSet )
+ throw( CmdLineParseException("Mutually exclusive argument"
+ " already set!", toString()));
+ else
+ throw( CmdLineParseException("Argument already set!",
+ toString()) );
+ }
+
+ if ( Arg::delimiter() != ' ' && value == "" )
+ throw( ArgParseException("Couldn't find delimiter for this argument!",
+ toString() ) );
+
+ if ( value == "" )
{
- (*i)++;
- if ( static_cast<unsigned int>(*i) < args.size() )
- _extractValue( args[*i] );
- else
- throw( ArgParseException("Missing a value for this argument!",
- toString() ) );
+ (*i)++;
+ if ( static_cast<unsigned int>(*i) < args.size() )
+ _extractValue( args[*i] );
+ else
+ throw( ArgParseException("Missing a value for this argument!",
+ toString() ) );
}
- else
- _extractValue( value );
-
- _alreadySet = true;
- _checkWithVisitor();
- return true;
- }
- else
- return false;
+ else
+ _extractValue( value );
+
+ _alreadySet = true;
+ _checkWithVisitor();
+ return true;
+ }
+ else
+ return false;
}
/**
@@ -382,8 +387,8 @@ bool ValueArg<T>::processArg(int *i, std::vector<std::string>& args)
template<class T>
std::string ValueArg<T>::shortID(const std::string& val) const
{
- static_cast<void>(val); // Ignore input, don't warn
- return Arg::shortID( _typeDesc );
+ static_cast<void>(val); // Ignore input, don't warn
+ return Arg::shortID( _typeDesc );
}
/**
@@ -392,32 +397,32 @@ std::string ValueArg<T>::shortID(const std::string& val) const
template<class T>
std::string ValueArg<T>::longID(const std::string& val) const
{
- static_cast<void>(val); // Ignore input, don't warn
- return Arg::longID( _typeDesc );
+ static_cast<void>(val); // Ignore input, don't warn
+ return Arg::longID( _typeDesc );
}
template<class T>
void ValueArg<T>::_extractValue( const std::string& val )
{
- try {
- ExtractValue(_value, val, typename ArgTraits<T>::ValueCategory());
- } catch( ArgParseException &e) {
- throw ArgParseException(e.error(), toString());
- }
+ try {
+ ExtractValue(_value, val, typename ArgTraits<T>::ValueCategory());
+ } catch( ArgParseException &e) {
+ throw ArgParseException(e.error(), toString());
+ }
- if ( _constraint != NULL )
- if ( ! _constraint->check( _value ) )
- throw( CmdLineParseException( "Value '" + val +
- + "' does not meet constraint: "
- + _constraint->description(),
- toString() ) );
+ if ( _constraint != NULL )
+ if ( ! _constraint->check( _value ) )
+ throw( CmdLineParseException( "Value '" + val +
+ + "' does not meet constraint: "
+ + _constraint->description(),
+ toString() ) );
}
template<class T>
void ValueArg<T>::reset()
{
- Arg::reset();
- _value = _default;
+ Arg::reset();
+ _value = _default;
}
} // namespace TCLAP
diff --git a/TCLAP/tclap/ValuesConstraint.h b/TCLAP/tclap/ValuesConstraint.h
index d1c1df7..9851432 100644
--- a/TCLAP/tclap/ValuesConstraint.h
+++ b/TCLAP/tclap/ValuesConstraint.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
@@ -5,6 +7,7 @@
* file: ValuesConstraint.h
*
* Copyright (c) 2005, Michael E. Smoot
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -48,7 +51,7 @@ class ValuesConstraint : public Constraint<T>
* Constructor.
* \param allowed - vector of allowed values.
*/
- ValuesConstraint(std::vector<T>& allowed);
+ ValuesConstraint(std::vector<T>const& allowed);
/**
* Virtual destructor.
@@ -87,21 +90,13 @@ class ValuesConstraint : public Constraint<T>
};
template<class T>
-ValuesConstraint<T>::ValuesConstraint(std::vector<T>& allowed)
+ValuesConstraint<T>::ValuesConstraint(std::vector<T> const& allowed)
: _allowed(allowed),
_typeDesc("")
{
for ( unsigned int i = 0; i < _allowed.size(); i++ )
{
-
-#if defined(HAVE_SSTREAM)
std::ostringstream os;
-#elif defined(HAVE_STRSTREAM)
- std::ostrstream os;
-#else
-#error "Need a stringstream (sstream or strstream) to compile!"
-#endif
-
os << _allowed[i];
std::string temp( os.str() );
diff --git a/TCLAP/tclap/Visitor.h b/TCLAP/tclap/Visitor.h
index 393320a..2a7bfd1 100644
--- a/TCLAP/tclap/Visitor.h
+++ b/TCLAP/tclap/Visitor.h
@@ -1,9 +1,12 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
* file: Visitor.h
*
* Copyright (c) 2003, Michael E. Smoot .
+ * Copyright (c) 2017, Google LLC
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
@@ -43,9 +46,10 @@ class Visitor
virtual ~Visitor() { }
/**
- * Does nothing. Should be overridden by child.
+ * This method (to implemented by children) will be
+ * called when the visitor is visited.
*/
- virtual void visit() { }
+ virtual void visit() = 0;
};
}
diff --git a/TCLAP/tclap/XorHandler.h b/TCLAP/tclap/XorHandler.h
index 64fcffc..e80f9ee 100644
--- a/TCLAP/tclap/XorHandler.h
+++ b/TCLAP/tclap/XorHandler.h
@@ -1,3 +1,5 @@
+// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
+
/******************************************************************************
*
@@ -55,8 +57,8 @@ class XorHandler
* Add a list of Arg*'s that will be xor'd together.
* \param ors - list of Arg* that will be xor'd.
*/
- void add( std::vector<Arg*>& ors );
-
+ void add( const std::vector<Arg*>& ors );
+
/**
* Checks whether the specified Arg is in one of the xor lists and
* if it does match one, returns the size of the xor list that the
@@ -84,7 +86,7 @@ class XorHandler
*/
bool contains( const Arg* a );
- std::vector< std::vector<Arg*> >& getXorList();
+ const std::vector< std::vector<Arg*> >& getXorList() const;
};
@@ -92,8 +94,8 @@ class XorHandler
//////////////////////////////////////////////////////////////////////
//BEGIN XOR.cpp
//////////////////////////////////////////////////////////////////////
-inline void XorHandler::add( std::vector<Arg*>& ors )
-{
+inline void XorHandler::add( const std::vector<Arg*>& ors )
+{
_orList.push_back( ors );
}
@@ -150,7 +152,7 @@ inline bool XorHandler::contains( const Arg* a )
return false;
}
-inline std::vector< std::vector<Arg*> >& XorHandler::getXorList()
+inline const std::vector< std::vector<Arg*> >& XorHandler::getXorList() const
{
return _orList;
}
diff --git a/TCLAP/tclap/ZshCompletionOutput.h b/TCLAP/tclap/ZshCompletionOutput.h
index acf655b..5a9268c 100644
--- a/TCLAP/tclap/ZshCompletionOutput.h
+++ b/TCLAP/tclap/ZshCompletionOutput.h
@@ -237,8 +237,9 @@ inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex)
if ( a->isValueRequired() )
{
std::string arg = a->shortID();
- // Example arg: "[-A <integer>] ... "
- size_t pos = arg.rfind(" ... ");
+ // Example arg: "[-A <integer>] ..."
+ size_t pos = arg.rfind(" ...");
+
if (pos != std::string::npos) {
arg.erase(pos);
}
diff --git a/readme.md b/readme.md
index b97e457..2e8c947 100644
--- a/readme.md
+++ b/readme.md
@@ -130,6 +130,15 @@ This option allows G2/G3 commands to be generated when using vase mode. This is
* Long Parameter: --allow-3d-arcs
* Example: ```ArcWelder --allow-3d-arcs```
+### Allow Travel Arcs
+This option allows G2/G3 commands to be generated when for travel moves. In general, most travel moves will not be converted for the average 3D print. However, for plotters or CNC, or certain slicers that perform wipe actions while retracting, this feature can be useful. This is an experimental option.
+
+* Type: Flag
+* Default: False
+* Short Parameter: -y
+* Long Parameter: --allow-travel-arcs
+* Example: ```ArcWelder --allow-travel-arcs```
+
### Allow Dynamic Precision
Not all gcode has the same precision for X, Y, and Z parameters. Enabling this option will cause the precision to grow as ArcWelder encounters gcodes with higher precision. This may increase gcode size somewhat, depending on the precision of the gcode commands in your file.
@@ -182,6 +191,7 @@ This is the default length of a segment in your firmware. This setting MUST mat
* Short Parameter: -s=<decimal_value>
* Long Parameter: --mm-per-arc-segment=<decimal_value>
* Example: ```ArcWelder --mm-per-arc-segment=1.0```
+
#### Minimum Arc Segments
This specifies the minimum number of segments that a circle of the same radius must have and is the parameter that determines how much compensation will be applied. This setting was inspired by the Marlin 2.0 arc interpolation algorithm and attempts to follow it as closely as possible. The higher the value, the more compensation will be applied, and the less compression you will get. A minimum of 14 is recommended. Values above 24 are NOT recommended. In general, this should be set as low as possible.
@@ -201,6 +211,37 @@ ArcWelder --mm-per-arc-segment=1.0 --min-arc-segments=14
This should produce much more rounded small arcs. However, in some cases you will want more detail (again, at the cost of compression, which reduces the effectiveness of ArcWelder), increase --min-arc-segments up to around 24. I don't recommend going higher than this since you will start to get lots of uncompressed gcode in areas that need it.
+#### Extrusion Rate Variance
+This feature allows ArcWelder to abort an arc if the extrusion rate changes by more than the value set here. Note that a setting of 0.050 = 5.0%. This option especially useful for prints using Cura's Arachne engine, but is also useful for regular prints. Set this value to 0 to disable this feature.
+
+* Type: Value
+* Default: 0.05 (5.0%)
+* Short Parameter: -v=<decimal_value> (0.05 = 5.0%, 0 to disable)
+* Long Parameter: --extrusion-rate-variance-percent=<decimal_value>
+* Example: ```ArcWelder --extrusion-rate-variance-percent=0.025```
+
+#### Maximum Gcode Length
+Some firmware has a problem with long gcode commands, and G2/G3 commands are some of the longest. You can specify a maximum gcode length to prevent long commands from being generated, which will reduce compression by a tiny amount.
+
+* Type: Value
+* Default: 0 (no limit)
+* Short Parameter: -c=<integer_value>
+* Long Parameter: --max-gcode-length=<integer_value>
+* Example: ```ArcWelder --max-gcode-length=50```
+
+### Progress Type
+This setting allows you to control the type of progress messages the ArcWelder console application will display. There are three options:
+
+* SIMPLE - This is the default setting. Here is a sample simple progress message: ```Progress: 21.9% complete - Estimated 35 of 45 seconds remaing.```
+* FULL - This will show a much more detailed message, which is useful for any applications that which to scrape the detailed progress messages. Here is a sample full progress message: ```Progress: percent_complete:100.00, seconds_elapsed:0.01, seconds_remaining:0.00, gcodes_processed: 4320, current_file_line: 4320, points_compressed: 2092, arcs_created: 81, arcs_aborted_by_flowrate: 59, num_firmware_compensations: 0, num_gcode_length_exceptions: 0, compression_ratio: 2.27, size_reduction: 55.96%```
+* NONE - No progress messages will be shown.
+
+* Type: Flag
+* Default: SIMPLE
+* Short Parameter: -P
+* Long Parameter: --progress-type
+* Example: ```ArcWelder --progress-type=FULL```
+
## Slicer Integrations
It's easy to integrate ArcWelder with most slicers.
@@ -285,11 +326,124 @@ See the [G90 Influences Extruder](#g90-influences-extruder) section for more inf
# Arc Straightener
This is the opposite of ArcWelder. It will find any G2/G3 commands and replace them with G1 commands. This is useful for testing firmware settings and generally seeing what the firmware is doing with your arc commands.
-The arc interpolation algorithm used here is a port of the Marlin 2.x interpolation code. This makes it especially easy to work with.
+The latest version includes several implementations of the arc interpolation algorithms from several different firmware types and versions. This tool can be extremely useful for tracking down firmware issues when running G2/G3 commands.
-I will add better documentation for this soon, but since it is a development tool, you'll probably be able to figure it out by using the --help argument like so:
+You can get a full list of parameters using the --help argument like so:
```
ArcStraightener --help
```
+#### Firmware Type
+Currently there are 5 different firmware types available: MARLIN_1, MARLIN_2, REPETIER, PRUSA, SMOOTHIEWARE
+
+* Type: Value
+* Default: MARLIN_2
+* Short Parameter: -f=<string>
+* Long Parameter: --firmware-type=<string>
+* Example: ```--firmware-type==PRUSA```
+
+#### Firmware Version
+Use this argument to specify the firmware version. Not all versions are supported. To see a list of available versions for each firmware type, use the --help argument. Note that the LATEST_RELEASE parameter does not always point to the most recent version, but rather the most recent stable release. Also, the PRUSA firmware version V3_11_0 is not yet released, but was added assuming new arc interpolation parameters from the roadmap will be included.
+
+* Type: Value
+* Default: LATEST_RELEASE
+* Short Parameter: -V=<string>
+* Long Parameter: --firmware_version=<string>
+* Example: ```--firmware_version==V1_1_9_1```
+
+#### Print Firmware Defaults and Supported Settings
+Prints all avaliable settings and defaults for the provided firmware type and version. When using this parameter, all other valid parameters will be ignored.
+
+Note: Supply the --firmware_type and --firmware_version to see the defaults and supported settings.
+
+* Type: Flag
+* Short Parameter: -p
+* Long Parameter: --print-firmware-defaults
+* Example: ```ArcStraightener --print-firmware-defaults --firmware_type=PRUSA --firmware_version==V1_1_9_1```
+
+## Firmware Specific Settings
+The different firmware types and versions all support different arc interpolation settings. See the Print Firmware Defaults section for info on how to discover what paramaters a specific firmware version supports, as well as the defaults.
+
+#### G90/G91 Influences Extruder
+Sets the firmware's G90/G91 influences extruder axis behavior. By default this is determined by the firmware's behavior.
+
+* Type: Value
+* Default: Set By Firmware Type and Version
+* Short Parameter: -g=<TRUE,FALSE>
+* Long Parameter: --g90-influences-extruder=<string>
+* Example: ```ArcStraightener <SOURCE> --firmware_type=PRUSA --firmware_version==V1_1_9_1 --g90-influences-extruder=TRUE```
+
+Note, in the example above, the default behavior of the prusa firmware is overridden by the argument.
+
+#### MM Per Arc Segment
+This is the default segment length for arc interpolation. Depending on the implementation, arcs could be longer or shorter than this value.
+
+* Type: Value (millimeters)
+* Default: 1.0
+* Short Parameter: -m=<decimal_value>
+* Long Parameter: --mm-per-arc-segment=<decimal_value>
+* Example: ```ArcStraightener <SOURCE> --mm-per-arc-segment=0.5```
+
+#### Max Arc Segment MM
+This is the maximum length an arc segment can be.
+
+* Type: Value (millimeters)
+* Default: 1.0
+* Short Parameter: -d=<decimal_value>
+* Long Parameter: --max-arc-segment-mm=<decimal_value>
+* Example: ```ArcStraightener <SOURCE> --max-arc-segment-mm=0.5```
+
+#### Min Arc Segment MM
+This is the Minimum length an arc segment can be.
+
+* Type: Value (millimeters)
+* Default: 1.0
+* Short Parameter: -n=<decimal_value>
+* Long Parameter: --min-mm-per-arc-segment=<decimal_value>
+* Example: ```ArcStraightener <SOURCE> --min-mm-per-arc-segment=0.5```
+
+#### Min Arc Segments
+The minimum number of segments within a circle of the same radius as the arc. Can be used to increase detail on small arcs.
+
+* Type: Integer Value
+* Default: 24
+* Short Parameter: -r=<integer_value>
+* Long Parameter: --min-arc-segments=<integer_value>
+* Example: ```ArcStraightener <SOURCE> --min-arc-segments=24```
+
+#### Min Circle Segments
+This is a the same as the Min Arc Segments setting used in some firmware versions. Can be used to increase detail on small arcs.
+
+* Type: Integer Value
+* Default: 72
+* Short Parameter: -a=<integer_value>
+* Long Parameter: --min-circle-segments=<integer_value>
+* Example: ```ArcStraightener <SOURCE> --min-circle-segments=24```
+
+#### N Arc Correction
+The number of segments that will be interpolated using a small angle approximation before true sin/cos corrections are applied. A value less than or equal to 1 will disable this feature. Note that enabling this can cause visible interpolation errors, especially on arcs with a very large radius. Disabling this setting could cause performance issues on slower hardware.
+
+* Type: Integer Value
+* Default: 24
+* Short Parameter: -c=<integer_value>
+* Long Parameter: --n-arc-correction=<integer_value>
+* Example: ```ArcStraightener <SOURCE> --n-arc-correction=8```
+
+#### Arc Segments Per Second
+The number of segments per second. This will produce a constant number of arcs, clamped between mm-per-arc-segment and min-mm-per-arc-segment. Can be used to prevent stuttering when printing very quickly. A value less than or equal to 0 will disable this feature.
+
+* Type: Integer Value
+* Default: 0 (Disabled)
+* Short Parameter: -s=<integer_value>
+* Long Parameter: --arc-segments-per-second=<integer_value>
+* Example: ```ArcStraightener <SOURCE> --arc-segments-per-second=24```
+
+#### MM Max Arc Error
+I'm not 100% sure exactly what this does, but I believe it attempts to limit the drift in the arc path to this value in MM. When I know more I will update this description. This currently is only used in Smoothieware. Set to 0 to disable.
+
+* Type: Value (millimeters)
+* Default: 0.01
+* Short Parameter: -e=<decimal_value>
+* Long Parameter: --mm-max-arc-error=<decimal_value>
+* Example: ```ArcStraightener <SOURCE> --mm-max-arc-error=0.25``` \ No newline at end of file