Add version command to solvespace-cli
parent
2e1f5324c8
commit
ebb194eda6
|
@ -4,6 +4,7 @@
|
||||||
// Copyright 2016 whitequark
|
// Copyright 2016 whitequark
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#include "solvespace.h"
|
#include "solvespace.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
static void ShowUsage(const std::string &cmd) {
|
static void ShowUsage(const std::string &cmd) {
|
||||||
fprintf(stderr, "Usage: %s <command> <options> <filename> [filename...]", cmd.c_str());
|
fprintf(stderr, "Usage: %s <command> <options> <filename> [filename...]", cmd.c_str());
|
||||||
|
@ -29,6 +30,8 @@ Common options:
|
||||||
Whether to export the background colour in vector formats. Defaults to off.
|
Whether to export the background colour in vector formats. Defaults to off.
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
|
version
|
||||||
|
Prints the current solvespace version.
|
||||||
thumbnail --output <pattern> --size <size> --view <direction>
|
thumbnail --output <pattern> --size <size> --view <direction>
|
||||||
[--chord-tol <tolerance>]
|
[--chord-tol <tolerance>]
|
||||||
Outputs a rendered view of the sketch, like the SolveSpace GUI would.
|
Outputs a rendered view of the sketch, like the SolveSpace GUI would.
|
||||||
|
@ -174,7 +177,10 @@ static bool RunCommand(const std::vector<std::string> args) {
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned width = 0, height = 0;
|
unsigned width = 0, height = 0;
|
||||||
if(args[1] == "thumbnail") {
|
if(args[1] == "version") {
|
||||||
|
fprintf(stderr, "SolveSpace version %s \n\n", PACKAGE_VERSION);
|
||||||
|
return false;
|
||||||
|
} else if(args[1] == "thumbnail") {
|
||||||
auto ParseSize = [&](size_t &argn) {
|
auto ParseSize = [&](size_t &argn) {
|
||||||
if(argn + 1 < args.size() && args[argn] == "--size") {
|
if(argn + 1 < args.size() && args[argn] == "--size") {
|
||||||
argn++;
|
argn++;
|
||||||
|
|
Loading…
Reference in New Issue