Move FormatString and tclap into their own external/ directory
This commit is contained in:
parent
c06ca7bf99
commit
1827b27996
@ -24,7 +24,7 @@ add_executable(
|
|||||||
src/Location.cpp
|
src/Location.cpp
|
||||||
src/Error.h
|
src/Error.h
|
||||||
src/Error.cpp
|
src/Error.cpp
|
||||||
src/FormatString/FormatString.hpp
|
src/external/FormatString/FormatString.hpp
|
||||||
src/FileIO.h
|
src/FileIO.h
|
||||||
src/FileIO.cpp
|
src/FileIO.cpp
|
||||||
src/Importer.cpp
|
src/Importer.cpp
|
||||||
@ -59,8 +59,8 @@ add_executable(
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(sapphirec PUBLIC src)
|
target_include_directories(sapphirec PUBLIC src)
|
||||||
target_include_directories(sapphirec PUBLIC src/tclap-1.2.5/include)
|
target_include_directories(sapphirec PUBLIC src/external/tclap-1.2.5/include)
|
||||||
|
target_include_directories(sapphirec PUBLIC src/external)
|
||||||
target_precompile_headers(sapphirec PUBLIC src/sapphirepch.h)
|
target_precompile_headers(sapphirec PUBLIC src/sapphirepch.h)
|
||||||
|
|
||||||
llvm_map_components_to_libnames(llvm_libs support core irreader)
|
llvm_map_components_to_libnames(llvm_libs support core irreader)
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
// Taken from https://github.com/InversePalindrome/Blog/blob/master/FormatString/FormatString.hpp
|
|
||||||
|
|
||||||
/*
|
|
||||||
Copyright (c) 2019 Inverse Palindrome
|
|
||||||
Blog - FormatString.hpp
|
|
||||||
https://inversepalindrome.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
auto convert(T&& t)
|
|
||||||
{
|
|
||||||
if constexpr (std::is_same<std::remove_cv_t<std::remove_reference_t<T>>, std::string>::value)
|
|
||||||
{
|
|
||||||
return std::forward<T>(t).c_str();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return std::forward<T>(t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
std::string format_string_internal(const std::string& format, Args&& ... args)
|
|
||||||
{
|
|
||||||
const auto size = std::snprintf(nullptr, 0, format.c_str(), std::forward<Args>(args)...) + 1;
|
|
||||||
const auto buffer = std::make_unique<char[]>(size);
|
|
||||||
|
|
||||||
std::snprintf(buffer.get(), size, format.c_str(), std::forward<Args>(args)...);
|
|
||||||
|
|
||||||
return std::string(buffer.get(), buffer.get() + size - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
std::string format_string(const std::string& format, Args&& ... args)
|
|
||||||
{
|
|
||||||
return format_string_internal(format, convert(std::forward<Args>(args))...);
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Inverse Palindrome
|
|
||||||
|
|
||||||
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.
|
|
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
original author: Michael E. Smoot
|
|
||||||
current maintainer: Daniel Aarno
|
|
||||||
more contributions: Erik Zeek
|
|
||||||
more contributions: Fabien Carmagnac (Tinbergen-AM)
|
|
||||||
outstanding editing: Carol Smoot
|
|
@ -1,27 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,182 +0,0 @@
|
|||||||
Basic Installation
|
|
||||||
==================
|
|
||||||
|
|
||||||
These are generic installation instructions.
|
|
||||||
|
|
||||||
The `configure' shell script attempts to guess correct values for
|
|
||||||
various system-dependent variables used during compilation. It uses
|
|
||||||
those values to create a `Makefile' in each directory of the package.
|
|
||||||
It may also create one or more `.h' files containing system-dependent
|
|
||||||
definitions. Finally, it creates a shell script `config.status' that
|
|
||||||
you can run in the future to recreate the current configuration, a file
|
|
||||||
`config.cache' that saves the results of its tests to speed up
|
|
||||||
reconfiguring, and a file `config.log' containing compiler output
|
|
||||||
(useful mainly for debugging `configure').
|
|
||||||
|
|
||||||
If you need to do unusual things to compile the package, please try
|
|
||||||
to figure out how `configure' could check whether to do them, and mail
|
|
||||||
diffs or instructions to the address given in the `README' so they can
|
|
||||||
be considered for the next release. If at some point `config.cache'
|
|
||||||
contains results you don't want to keep, you may remove or edit it.
|
|
||||||
|
|
||||||
The file `configure.in' is used to create `configure' by a program
|
|
||||||
called `autoconf'. You only need `configure.in' if you want to change
|
|
||||||
it or regenerate `configure' using a newer version of `autoconf'.
|
|
||||||
|
|
||||||
The simplest way to compile this package is:
|
|
||||||
|
|
||||||
1. `cd' to the directory containing the package's source code and type
|
|
||||||
`./configure' to configure the package for your system. If you're
|
|
||||||
using `csh' on an old version of System V, you might need to type
|
|
||||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
|
||||||
`configure' itself.
|
|
||||||
|
|
||||||
Running `configure' takes awhile. While running, it prints some
|
|
||||||
messages telling which features it is checking for.
|
|
||||||
|
|
||||||
2. Type `make' to compile the package.
|
|
||||||
|
|
||||||
3. Optionally, type `make check' to run any self-tests that come with
|
|
||||||
the package.
|
|
||||||
|
|
||||||
4. Type `make install' to install the programs and any data files and
|
|
||||||
documentation.
|
|
||||||
|
|
||||||
5. You can remove the program binaries and object files from the
|
|
||||||
source code directory by typing `make clean'. To also remove the
|
|
||||||
files that `configure' created (so you can compile the package for
|
|
||||||
a different kind of computer), type `make distclean'. There is
|
|
||||||
also a `make maintainer-clean' target, but that is intended mainly
|
|
||||||
for the package's developers. If you use it, you may have to get
|
|
||||||
all sorts of other programs in order to regenerate files that came
|
|
||||||
with the distribution.
|
|
||||||
|
|
||||||
Compilers and Options
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that
|
|
||||||
the `configure' script does not know about. You can give `configure'
|
|
||||||
initial values for variables by setting them in the environment. Using
|
|
||||||
a Bourne-compatible shell, you can do that on the command line like
|
|
||||||
this:
|
|
||||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
|
||||||
|
|
||||||
Or on systems that have the `env' program, you can do it like this:
|
|
||||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
|
||||||
|
|
||||||
Compiling For Multiple Architectures
|
|
||||||
====================================
|
|
||||||
|
|
||||||
You can compile the package for more than one kind of computer at the
|
|
||||||
same time, by placing the object files for each architecture in their
|
|
||||||
own directory. To do this, you must use a version of `make' that
|
|
||||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
|
||||||
directory where you want the object files and executables to go and run
|
|
||||||
the `configure' script. `configure' automatically checks for the
|
|
||||||
source code in the directory that `configure' is in and in `..'.
|
|
||||||
|
|
||||||
If you have to use a `make' that does not supports the `VPATH'
|
|
||||||
variable, you have to compile the package for one architecture at a time
|
|
||||||
in the source code directory. After you have installed the package for
|
|
||||||
one architecture, use `make distclean' before reconfiguring for another
|
|
||||||
architecture.
|
|
||||||
|
|
||||||
Installation Names
|
|
||||||
==================
|
|
||||||
|
|
||||||
By default, `make install' will install the package's files in
|
|
||||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
|
||||||
installation prefix other than `/usr/local' by giving `configure' the
|
|
||||||
option `--prefix=PATH'.
|
|
||||||
|
|
||||||
You can specify separate installation prefixes for
|
|
||||||
architecture-specific files and architecture-independent files. If you
|
|
||||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
|
||||||
PATH as the prefix for installing programs and libraries.
|
|
||||||
Documentation and other data files will still use the regular prefix.
|
|
||||||
|
|
||||||
In addition, if you use an unusual directory layout you can give
|
|
||||||
options like `--bindir=PATH' to specify different values for particular
|
|
||||||
kinds of files. Run `configure --help' for a list of the directories
|
|
||||||
you can set and what kinds of files go in them.
|
|
||||||
|
|
||||||
If the package supports it, you can cause programs to be installed
|
|
||||||
with an extra prefix or suffix on their names by giving `configure' the
|
|
||||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
|
||||||
|
|
||||||
Optional Features
|
|
||||||
=================
|
|
||||||
|
|
||||||
Some packages pay attention to `--enable-FEATURE' options to
|
|
||||||
`configure', where FEATURE indicates an optional part of the package.
|
|
||||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
|
||||||
is something like `gnu-as' or `x' (for the X Window System). The
|
|
||||||
`README' should mention any `--enable-' and `--with-' options that the
|
|
||||||
package recognizes.
|
|
||||||
|
|
||||||
For packages that use the X Window System, `configure' can usually
|
|
||||||
find the X include and library files automatically, but if it doesn't,
|
|
||||||
you can use the `configure' options `--x-includes=DIR' and
|
|
||||||
`--x-libraries=DIR' to specify their locations.
|
|
||||||
|
|
||||||
Specifying the System Type
|
|
||||||
==========================
|
|
||||||
|
|
||||||
There may be some features `configure' can not figure out
|
|
||||||
automatically, but needs to determine by the type of host the package
|
|
||||||
will run on. Usually `configure' can figure that out, but if it prints
|
|
||||||
a message saying it can not guess the host type, give it the
|
|
||||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
|
||||||
type, such as `sun4', or a canonical name with three fields:
|
|
||||||
CPU-COMPANY-SYSTEM
|
|
||||||
|
|
||||||
See the file `config.sub' for the possible values of each field. If
|
|
||||||
`config.sub' isn't included in this package, then this package doesn't
|
|
||||||
need to know the host type.
|
|
||||||
|
|
||||||
If you are building compiler tools for cross-compiling, you can also
|
|
||||||
use the `--target=TYPE' option to select the type of system they will
|
|
||||||
produce code for and the `--build=TYPE' option to select the type of
|
|
||||||
system on which you are compiling the package.
|
|
||||||
|
|
||||||
Sharing Defaults
|
|
||||||
================
|
|
||||||
|
|
||||||
If you want to set default values for `configure' scripts to share,
|
|
||||||
you can create a site shell script called `config.site' that gives
|
|
||||||
default values for variables like `CC', `cache_file', and `prefix'.
|
|
||||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
|
||||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
|
||||||
`CONFIG_SITE' environment variable to the location of the site script.
|
|
||||||
A warning: not all `configure' scripts look for a site script.
|
|
||||||
|
|
||||||
Operation Controls
|
|
||||||
==================
|
|
||||||
|
|
||||||
`configure' recognizes the following options to control how it
|
|
||||||
operates.
|
|
||||||
|
|
||||||
`--cache-file=FILE'
|
|
||||||
Use and save the results of the tests in FILE instead of
|
|
||||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
|
||||||
debugging `configure'.
|
|
||||||
|
|
||||||
`--help'
|
|
||||||
Print a summary of the options to `configure', and exit.
|
|
||||||
|
|
||||||
`--quiet'
|
|
||||||
`--silent'
|
|
||||||
`-q'
|
|
||||||
Do not print messages saying which checks are being made. To
|
|
||||||
suppress all normal output, redirect it to `/dev/null' (any error
|
|
||||||
messages will still be shown).
|
|
||||||
|
|
||||||
`--srcdir=DIR'
|
|
||||||
Look for the package's source code in directory DIR. Usually
|
|
||||||
`configure' can determine that directory automatically.
|
|
||||||
|
|
||||||
`--version'
|
|
||||||
Print the version of Autoconf used to generate the `configure'
|
|
||||||
script, and exit.
|
|
||||||
|
|
||||||
`configure' also accepts some other, not widely useful, options.
|
|
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
|
||||||
|
|
||||||
SUBDIRS = include examples docs tests msc config
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
|
||||||
pkgconfig_DATA = $(PACKAGE).pc
|
|
||||||
EXTRA_DIST = $(PACKAGE).pc.in
|
|
||||||
|
|
||||||
DISTCLEANFILES = $(PACKAGE).pc
|
|
@ -1,830 +0,0 @@
|
|||||||
# 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 = .
|
|
||||||
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 $(top_srcdir)/configure \
|
|
||||||
$(am__configure_deps) $(am__DIST_COMMON)
|
|
||||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
|
||||||
configure.lineno config.status.lineno
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
|
||||||
CONFIG_CLEAN_FILES = tclap.pc
|
|
||||||
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 =
|
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
|
||||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
|
||||||
install-data-recursive install-dvi-recursive \
|
|
||||||
install-exec-recursive install-html-recursive \
|
|
||||||
install-info-recursive install-pdf-recursive \
|
|
||||||
install-ps-recursive install-recursive installcheck-recursive \
|
|
||||||
installdirs-recursive pdf-recursive ps-recursive \
|
|
||||||
tags-recursive uninstall-recursive
|
|
||||||
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)$(pkgconfigdir)"
|
|
||||||
DATA = $(pkgconfig_DATA)
|
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
|
||||||
distclean-recursive maintainer-clean-recursive
|
|
||||||
am__recursive_targets = \
|
|
||||||
$(RECURSIVE_TARGETS) \
|
|
||||||
$(RECURSIVE_CLEAN_TARGETS) \
|
|
||||||
$(am__extra_recursive_targets)
|
|
||||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
|
||||||
cscope distdir distdir-am dist dist-all distcheck
|
|
||||||
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)`
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/tclap.pc.in \
|
|
||||||
$(top_srcdir)/config/install-sh $(top_srcdir)/config/missing \
|
|
||||||
$(top_srcdir)/config/mkinstalldirs AUTHORS COPYING ChangeLog \
|
|
||||||
INSTALL NEWS README
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
top_distdir = $(distdir)
|
|
||||||
am__remove_distdir = \
|
|
||||||
if test -d "$(distdir)"; then \
|
|
||||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
|
||||||
&& rm -rf "$(distdir)" \
|
|
||||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
|
||||||
else :; fi
|
|
||||||
am__post_remove_distdir = $(am__remove_distdir)
|
|
||||||
am__relativize = \
|
|
||||||
dir0=`pwd`; \
|
|
||||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
|
||||||
sed_rest='s,^[^/]*/*,,'; \
|
|
||||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
|
||||||
sed_butlast='s,/*[^/]*$$,,'; \
|
|
||||||
while test -n "$$dir1"; do \
|
|
||||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first" != "."; then \
|
|
||||||
if test "$$first" = ".."; then \
|
|
||||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
|
||||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
|
||||||
else \
|
|
||||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first2" = "$$first"; then \
|
|
||||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
|
||||||
else \
|
|
||||||
dir2="../$$dir2"; \
|
|
||||||
fi; \
|
|
||||||
dir0="$$dir0"/"$$first"; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
|
||||||
done; \
|
|
||||||
reldir="$$dir2"
|
|
||||||
DIST_ARCHIVES = $(distdir).tar.gz
|
|
||||||
GZIP_ENV = --best
|
|
||||||
DIST_TARGETS = dist-gzip
|
|
||||||
# Exists only to be overridden by the user if desired.
|
|
||||||
AM_DISTCHECK_DVI_TARGET = dvi
|
|
||||||
distuninstallcheck_listfiles = find . -type f -print
|
|
||||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
|
||||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
|
||||||
distcleancheck_listfiles = find . -type f -print
|
|
||||||
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@
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
|
||||||
SUBDIRS = include examples docs tests msc config
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
|
||||||
pkgconfig_DATA = $(PACKAGE).pc
|
|
||||||
EXTRA_DIST = $(PACKAGE).pc.in
|
|
||||||
DISTCLEANFILES = $(PACKAGE).pc
|
|
||||||
all: all-recursive
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
am--refresh: Makefile
|
|
||||||
@:
|
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
|
||||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
|
||||||
&& exit 0; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
echo ' $(SHELL) ./config.status'; \
|
|
||||||
$(SHELL) ./config.status;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
$(SHELL) ./config.status --recheck
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
|
||||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
|
||||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
tclap.pc: $(top_builddir)/config.status $(srcdir)/tclap.pc.in
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
|
||||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || 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_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-pkgconfigDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
|
||||||
# into them and run 'make' without going through this Makefile.
|
|
||||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
|
||||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
|
||||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
|
||||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
|
||||||
$(am__recursive_targets):
|
|
||||||
@fail=; \
|
|
||||||
if $(am__make_keepgoing); then \
|
|
||||||
failcom='fail=yes'; \
|
|
||||||
else \
|
|
||||||
failcom='exit 1'; \
|
|
||||||
fi; \
|
|
||||||
dot_seen=no; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
case "$@" in \
|
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
dot_seen=yes; \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| eval $$failcom; \
|
|
||||||
done; \
|
|
||||||
if test "$$dot_seen" = "no"; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|
||||||
fi; test -z "$$fail"
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-recursive
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
|
||||||
include_option=--etags-include; \
|
|
||||||
empty_fix=.; \
|
|
||||||
else \
|
|
||||||
include_option=--include; \
|
|
||||||
empty_fix=; \
|
|
||||||
fi; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test ! -f $$subdir/TAGS || \
|
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
$(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-recursive
|
|
||||||
|
|
||||||
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"
|
|
||||||
cscope: cscope.files
|
|
||||||
test ! -s cscope.files \
|
|
||||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
|
||||||
clean-cscope:
|
|
||||||
-rm -f cscope.files
|
|
||||||
cscope.files: clean-cscope cscopelist
|
|
||||||
cscopelist: cscopelist-recursive
|
|
||||||
|
|
||||||
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
|
|
||||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
$(am__remove_distdir)
|
|
||||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
|
||||||
@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
|
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
$(am__make_dryrun) \
|
|
||||||
|| test -d "$(distdir)/$$subdir" \
|
|
||||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|
||||||
|| exit 1; \
|
|
||||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_distdir=$$reldir; \
|
|
||||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_top_distdir=$$reldir; \
|
|
||||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
|
||||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
|
||||||
($(am__cd) $$subdir && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$$new_top_distdir" \
|
|
||||||
distdir="$$new_distdir" \
|
|
||||||
am__remove_distdir=: \
|
|
||||||
am__skip_length_check=: \
|
|
||||||
am__skip_mode_fix=: \
|
|
||||||
distdir) \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
-test -n "$(am__skip_mode_fix)" \
|
|
||||||
|| find "$(distdir)" -type d ! -perm -755 \
|
|
||||||
-exec chmod u+rwx,go+rx {} \; -o \
|
|
||||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
|
||||||
|| chmod -R a+r "$(distdir)"
|
|
||||||
dist-gzip: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-bzip2: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-lzip: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-xz: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zstd: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-tarZ: distdir
|
|
||||||
@echo WARNING: "Support for distribution archives compressed with" \
|
|
||||||
"legacy program 'compress' is deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-shar: distdir
|
|
||||||
@echo WARNING: "Support for shar distribution archives is" \
|
|
||||||
"deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zip: distdir
|
|
||||||
-rm -f $(distdir).zip
|
|
||||||
zip -rq $(distdir).zip $(distdir)
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist dist-all:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
# This target untars the dist file and tries a VPATH configuration. Then
|
|
||||||
# it guarantees that the distribution is self-contained by making another
|
|
||||||
# tarfile.
|
|
||||||
distcheck: dist
|
|
||||||
case '$(DIST_ARCHIVES)' in \
|
|
||||||
*.tar.gz*) \
|
|
||||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
|
||||||
*.tar.bz2*) \
|
|
||||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
|
||||||
*.tar.lz*) \
|
|
||||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
|
||||||
*.tar.xz*) \
|
|
||||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
|
||||||
*.tar.Z*) \
|
|
||||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
|
||||||
*.shar.gz*) \
|
|
||||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
|
||||||
*.zip*) \
|
|
||||||
unzip $(distdir).zip ;;\
|
|
||||||
*.tar.zst*) \
|
|
||||||
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
|
|
||||||
esac
|
|
||||||
chmod -R a-w $(distdir)
|
|
||||||
chmod u+w $(distdir)
|
|
||||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
|
||||||
chmod a-w $(distdir)
|
|
||||||
test -d $(distdir)/_build || exit 0; \
|
|
||||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
|
||||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
|
||||||
&& am__cwd=`pwd` \
|
|
||||||
&& $(am__cd) $(distdir)/_build/sub \
|
|
||||||
&& ../../configure \
|
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
|
||||||
distuninstallcheck \
|
|
||||||
&& chmod -R a-w "$$dc_install_base" \
|
|
||||||
&& ({ \
|
|
||||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
|
||||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
|
||||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
|
||||||
&& rm -rf "$$dc_destdir" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
|
||||||
&& rm -rf $(DIST_ARCHIVES) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
|
||||||
&& cd "$$am__cwd" \
|
|
||||||
|| exit 1
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
@(echo "$(distdir) archives ready for distribution: "; \
|
|
||||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
|
||||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
|
||||||
distuninstallcheck:
|
|
||||||
@test -n '$(distuninstallcheck_dir)' || { \
|
|
||||||
echo 'ERROR: trying to run $@ with an empty' \
|
|
||||||
'$$(distuninstallcheck_dir)' >&2; \
|
|
||||||
exit 1; \
|
|
||||||
}; \
|
|
||||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
|
||||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
|
||||||
exit 1; \
|
|
||||||
}; \
|
|
||||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left after uninstall:" ; \
|
|
||||||
if test -n "$(DESTDIR)"; then \
|
|
||||||
echo " (check DESTDIR support)"; \
|
|
||||||
fi ; \
|
|
||||||
$(distuninstallcheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
distcleancheck: distclean
|
|
||||||
@if test '$(srcdir)' = . ; then \
|
|
||||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
|
||||||
exit 1 ; \
|
|
||||||
fi
|
|
||||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
|
||||||
$(distcleancheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
check-am: all-am
|
|
||||||
check: check-recursive
|
|
||||||
all-am: Makefile $(DATA)
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
installdirs-am:
|
|
||||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-recursive
|
|
||||||
install-exec: install-exec-recursive
|
|
||||||
install-data: install-data-recursive
|
|
||||||
uninstall: uninstall-recursive
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
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)
|
|
||||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
|
||||||
|
|
||||||
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-recursive
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive
|
|
||||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-recursive
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-pkgconfigDATA
|
|
||||||
|
|
||||||
install-dvi: install-dvi-recursive
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-recursive
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-recursive
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-recursive
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-recursive
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive
|
|
||||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
|
||||||
-rm -rf $(top_srcdir)/autom4te.cache
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-recursive
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-recursive
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-pkgconfigDATA
|
|
||||||
|
|
||||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
|
||||||
am--refresh check check-am clean clean-cscope clean-generic \
|
|
||||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
|
||||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
|
||||||
dist-zstd distcheck distclean distclean-generic distclean-tags \
|
|
||||||
distcleancheck distdir distuninstallcheck 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-man install-pdf install-pdf-am \
|
|
||||||
install-pkgconfigDATA install-ps install-ps-am install-strip \
|
|
||||||
installcheck installcheck-am installdirs installdirs-am \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
|
||||||
uninstall-am uninstall-pkgconfigDATA
|
|
||||||
|
|
||||||
.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:
|
|
@ -1,12 +0,0 @@
|
|||||||
TCLAP - Templatized Command Line Argument Parser
|
|
||||||
|
|
||||||
This is a simple C++ library that facilitates parsing command line
|
|
||||||
arguments in a type independent manner. It doesn't conform exactly
|
|
||||||
to either the GNU or POSIX standards, although it is close. See
|
|
||||||
docs/manual.html for descriptions of how things work or look at the
|
|
||||||
simple examples in the examples dir.
|
|
||||||
|
|
||||||
To find out what the latest changes are read the NEWS file in this
|
|
||||||
directory.
|
|
||||||
|
|
||||||
Any and all feedback is welcome at https://sf.net/p/tclap/discussion/
|
|
1134
src/tclap-1.2.5/aclocal.m4
vendored
1134
src/tclap-1.2.5/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
EXTRA_DIST = ac_cxx_have_sstream.m4\
|
|
||||||
ac_cxx_have_strstream.m4\
|
|
||||||
ac_cxx_namespaces.m4\
|
|
||||||
bb_enable_doxygen.m4
|
|
||||||
|
|
||||||
|
|
@ -1,494 +0,0 @@
|
|||||||
# 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 = config
|
|
||||||
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 $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = 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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
|
||||||
config.h.in
|
|
||||||
# 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 $(srcdir)/config.h.in depcomp \
|
|
||||||
install-sh missing 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@
|
|
||||||
EXTRA_DIST = ac_cxx_have_sstream.m4\
|
|
||||||
ac_cxx_have_strstream.m4\
|
|
||||||
ac_cxx_namespaces.m4\
|
|
||||||
bb_enable_doxygen.m4
|
|
||||||
|
|
||||||
all: config.h
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) 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 config/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu config/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):
|
|
||||||
|
|
||||||
config.h: stamp-h1
|
|
||||||
@test -f $@ || rm -f stamp-h1
|
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
|
||||||
|
|
||||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
|
||||||
@rm -f stamp-h1
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status config/config.h
|
|
||||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
|
||||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
|
||||||
rm -f stamp-h1
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
distclean-hdr:
|
|
||||||
-rm -f config.h stamp-h1
|
|
||||||
|
|
||||||
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 config.h
|
|
||||||
installdirs:
|
|
||||||
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-hdr distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
.MAKE: all 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-hdr 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-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
|
|
||||||
|
|
||||||
.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:
|
|
@ -1,19 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_HAVE_LONG_LONG
|
|
||||||
dnl
|
|
||||||
dnl If the C++ implementation have a long long type
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_HAVE_LONG_LONG],
|
|
||||||
[AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_COMPILE([],[long long x = 1; return 0;],
|
|
||||||
ac_cv_cxx_have_long_long=yes, ac_cv_cxx_have_long_long=no)
|
|
||||||
|
|
||||||
if test "$ac_cv_cxx_have_long_long" = yes; then
|
|
||||||
AC_DEFINE(HAVE_LONG_LONG, 1,
|
|
||||||
[define if the C++ implementation have long long])
|
|
||||||
else
|
|
||||||
AC_DEFINE(HAVE_LONG_LONG, 0,
|
|
||||||
[define if the C++ implementation have long long])
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
@ -1,25 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_HAVE_SSTREAM
|
|
||||||
dnl
|
|
||||||
dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
|
|
||||||
dnl
|
|
||||||
dnl @author Ben Stanley
|
|
||||||
dnl @version $Id: ac_cxx_have_sstream.m4,v 1.2 2006/02/22 02:10:28 zeekec Exp $
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_HAVE_SSTREAM],
|
|
||||||
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_CHECK_HEADERS(sstream)
|
|
||||||
AC_CACHE_CHECK([whether the STL defines stringstream],
|
|
||||||
[ac_cv_cxx_have_sstream],
|
|
||||||
[AC_TRY_COMPILE([#include <sstream>
|
|
||||||
#ifdef HAVE_NAMESPACES
|
|
||||||
using namespace std;
|
|
||||||
#endif],[stringstream message; message << "Hello"; return 0;],
|
|
||||||
ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
|
|
||||||
])
|
|
||||||
if test "$ac_cv_cxx_have_sstream" = yes; then
|
|
||||||
AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream])
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
@ -1,28 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_HAVE_STRSTREAM
|
|
||||||
dnl
|
|
||||||
dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM.
|
|
||||||
dnl
|
|
||||||
dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_HAVE_STRSTREAM],
|
|
||||||
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_CHECK_HEADERS(strstream)
|
|
||||||
AC_CACHE_CHECK([whether the STL defines strstream],
|
|
||||||
[ac_cv_cxx_have_class_strstream],
|
|
||||||
[AC_TRY_COMPILE([#if HAVE_STRSTREAM
|
|
||||||
# include <strstream>
|
|
||||||
#else
|
|
||||||
# include <strstream.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_NAMESPACES
|
|
||||||
using namespace std;
|
|
||||||
#endif],[ostrstream message; message << "Hello"; return 0;],
|
|
||||||
ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no)
|
|
||||||
])
|
|
||||||
if test "$ac_cv_cxx_have_class_strstream" = yes; then
|
|
||||||
AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream])
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
@ -1,22 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_NAMESPACES
|
|
||||||
dnl
|
|
||||||
dnl If the compiler can prevent names clashes using namespaces, define
|
|
||||||
dnl HAVE_NAMESPACES.
|
|
||||||
dnl
|
|
||||||
dnl @version $Id: ac_cxx_namespaces.m4,v 1.1 2003/03/19 02:40:00 mes5k Exp $
|
|
||||||
dnl @author Luc Maisonobe
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_NAMESPACES],
|
|
||||||
[AC_CACHE_CHECK(whether the compiler implements namespaces,
|
|
||||||
ac_cv_cxx_namespaces,
|
|
||||||
[AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
|
|
||||||
[using namespace Outer::Inner; return i;],
|
|
||||||
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
if test "$ac_cv_cxx_namespaces" = yes; then
|
|
||||||
AC_DEFINE(HAVE_NAMESPACES,1,[define to 1 if the compiler implements namespaces])
|
|
||||||
fi
|
|
||||||
])
|
|
@ -1,31 +0,0 @@
|
|||||||
dnl HAVE_WARN_EFFECTIVE_CXX
|
|
||||||
dnl ----------------------
|
|
||||||
dnl
|
|
||||||
dnl If the C++ compiler accepts the `-Weffc++' flag,
|
|
||||||
dnl set output variable `WARN_EFFECTIVE_CXX' to `-Weffc++' and
|
|
||||||
dnl `WARN_NO_EFFECTIVE_CXX' to `-Wno-effc++'. Otherwise,
|
|
||||||
dnl leave both empty.
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([HAVE_WARN_EFFECTIVE_CXX],
|
|
||||||
[
|
|
||||||
AC_REQUIRE([AC_PROG_CXX])
|
|
||||||
AC_MSG_CHECKING([whether the C++ compiler (${CXX}) accepts -Weffc++])
|
|
||||||
AC_CACHE_VAL([_cv_warn_effective_cxx],
|
|
||||||
[
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
save_cxxflags="$CXXFLAGS"
|
|
||||||
CXXFLAGS="$CXXFLAGS -Weffc++"
|
|
||||||
AC_TRY_COMPILE([],[main();],
|
|
||||||
[_cv_warn_effective_cxx=yes], [_cv_warn_effective_cxx=no])
|
|
||||||
CXXFLAGS="$save_cxxflags"
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
AC_MSG_RESULT([$_cv_warn_effective_cxx])
|
|
||||||
if test "$_cv_warn_effective_cxx" = yes; then
|
|
||||||
WARN_EFFECTIVE_CXX=-Weffc++
|
|
||||||
WARN_NO_EFFECTIVE_CXX=-Wno-effc++
|
|
||||||
fi
|
|
||||||
AC_SUBST([WARN_EFFECTIVE_CXX])
|
|
||||||
AC_SUBST([WARN_NO_EFFECTIVE_CXX])
|
|
||||||
])
|
|
@ -1,18 +0,0 @@
|
|||||||
AC_DEFUN([BB_ENABLE_DOXYGEN],
|
|
||||||
[
|
|
||||||
AC_ARG_ENABLE(doxygen, [--enable-doxygen enable documentation generation with doxygen (auto)])
|
|
||||||
if test "x$enable_doxygen" = xno; then
|
|
||||||
enable_doc=no
|
|
||||||
else
|
|
||||||
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
|
|
||||||
if test x$DOXYGEN = x; then
|
|
||||||
if test "x$enable_doxygen" = xyes; then
|
|
||||||
AC_MSG_ERROR([could not find doxygen])
|
|
||||||
fi
|
|
||||||
enable_doc=no
|
|
||||||
else
|
|
||||||
enable_doc=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
|
|
||||||
])
|
|
@ -1,72 +0,0 @@
|
|||||||
/* config/config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* define if the library defines strstream */
|
|
||||||
#undef HAVE_CLASS_STRSTREAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* define if the C++ implementation have long long */
|
|
||||||
#undef HAVE_LONG_LONG
|
|
||||||
|
|
||||||
/* define to 1 if the compiler implements namespaces */
|
|
||||||
#undef HAVE_NAMESPACES
|
|
||||||
|
|
||||||
/* define if the compiler has stringstream */
|
|
||||||
#undef HAVE_SSTREAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#undef HAVE_STDIO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strstream> header file. */
|
|
||||||
#undef HAVE_STRSTREAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
|
||||||
required in a freestanding environment). This macro is provided for
|
|
||||||
backward compatibility; new code need not use it. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
@ -1,411 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# depcomp - compile a program generating dependencies as side-effects
|
|
||||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
|
||||||
|
|
||||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
|
||||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# `libtool' can also be set to `yes' or `no'.
|
|
||||||
|
|
||||||
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
|
||||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|
||||||
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
|
|
||||||
# Some modes work just like other modes, but use different flags. We
|
|
||||||
# parameterize here, but still list the modes in the big case below,
|
|
||||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
|
||||||
# here, because this file can only contain one case statement.
|
|
||||||
if test "$depmode" = hp; then
|
|
||||||
# HP compiler uses -M and no extra arg.
|
|
||||||
gccflag=-M
|
|
||||||
depmode=gcc
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$depmode" = dashXmstdout; then
|
|
||||||
# This is just like dashmstdout with a different argument.
|
|
||||||
dashmflag=-xM
|
|
||||||
depmode=dashmstdout
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$depmode" in
|
|
||||||
gcc3)
|
|
||||||
## gcc 3 implements dependency tracking that does exactly what
|
|
||||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
|
||||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
|
||||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
mv "$tmpdepfile" "$depfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
gcc)
|
|
||||||
## There are various ways to get dependency output from gcc. Here's
|
|
||||||
## why we pick this rather obscure method:
|
|
||||||
## - Don't want to use -MD because we'd like the dependencies to end
|
|
||||||
## up in a subdir. Having to rename by hand is ugly.
|
|
||||||
## (We might end up doing this anyway to support other compilers.)
|
|
||||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
|
||||||
## -MM, not -M (despite what the docs say).
|
|
||||||
## - Using -M directly means running the compiler twice (even worse
|
|
||||||
## than renaming).
|
|
||||||
if test -z "$gccflag"; then
|
|
||||||
gccflag=-MD,
|
|
||||||
fi
|
|
||||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
|
||||||
## The second -e expression handles DOS-style file names with drive letters.
|
|
||||||
sed -e 's/^[^:]*: / /' \
|
|
||||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
|
||||||
## This next piece of magic avoids the `deleted header file' problem.
|
|
||||||
## The problem is that when a header file which appears in a .P file
|
|
||||||
## is deleted, the dependency causes make to die (because there is
|
|
||||||
## typically no way to rebuild the header). We avoid this by adding
|
|
||||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
|
||||||
## this for us directly.
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" |
|
|
||||||
## Some versions of gcc put a space before the `:'. On the theory
|
|
||||||
## that the space means something, we add a space to the output as
|
|
||||||
## well.
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
hp)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
sgi)
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
|
||||||
else
|
|
||||||
"$@" -MDupdate "$tmpdepfile"
|
|
||||||
fi
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
|
|
||||||
# Clip off the initial element (the dependent). Don't try to be
|
|
||||||
# clever and replace this with sed code, as IRIX sed won't handle
|
|
||||||
# lines with more than a fixed number of characters (4096 in
|
|
||||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
|
||||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
|
||||||
# dependency line.
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
|
||||||
tr '
|
|
||||||
' ' ' >> $depfile
|
|
||||||
echo >> $depfile
|
|
||||||
|
|
||||||
# The second pass generates a dummy entry for each header file.
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
|
||||||
>> $depfile
|
|
||||||
else
|
|
||||||
# The sourcefile does not contain any dependencies, so just
|
|
||||||
# store a dummy comment line, to avoid errors with the Makefile
|
|
||||||
# "include basename.Plo" scheme.
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
aix)
|
|
||||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
|
||||||
# in a .u file. This file always lives in the current directory.
|
|
||||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
|
||||||
# $object doesn't have directory information.
|
|
||||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
|
||||||
tmpdepfile="$stripped.u"
|
|
||||||
outname="$stripped.o"
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" -Wc,-M
|
|
||||||
else
|
|
||||||
"$@" -M
|
|
||||||
fi
|
|
||||||
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
# Each line is of the form `foo.o: dependent.h'.
|
|
||||||
# Do two passes, one to just change these to
|
|
||||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
|
||||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
|
||||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
|
||||||
else
|
|
||||||
# The sourcefile does not contain any dependencies, so just
|
|
||||||
# store a dummy comment line, to avoid errors with the Makefile
|
|
||||||
# "include basename.Plo" scheme.
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
tru64)
|
|
||||||
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
|
|
||||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
|
||||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
|
||||||
# dependencies in `foo.d' instead, so we check for that too.
|
|
||||||
# Subdirectories are respected.
|
|
||||||
|
|
||||||
tmpdepfile1="$object.d"
|
|
||||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" -Wc,-MD
|
|
||||||
else
|
|
||||||
"$@" -MD
|
|
||||||
fi
|
|
||||||
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile1"; then
|
|
||||||
tmpdepfile="$tmpdepfile1"
|
|
||||||
else
|
|
||||||
tmpdepfile="$tmpdepfile2"
|
|
||||||
fi
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
|
||||||
# That's a space and a tab in the [].
|
|
||||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
|
||||||
else
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
#nosideeffect)
|
|
||||||
# This comment above is used by automake to tell side-effect
|
|
||||||
# dependency tracking mechanisms from slower ones.
|
|
||||||
|
|
||||||
dashmstdout)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the proprocessed file to stdout, regardless of -o,
|
|
||||||
# because we must use -o when running libtool.
|
|
||||||
test -z "$dashmflag" && dashmflag=-M
|
|
||||||
( IFS=" "
|
|
||||||
case " $* " in
|
|
||||||
*" --mode=compile "*) # this is libtool, let us make it quiet
|
|
||||||
for arg
|
|
||||||
do # cycle over the arguments
|
|
||||||
case "$arg" in
|
|
||||||
"--mode=compile")
|
|
||||||
# insert --quiet before "--mode=compile"
|
|
||||||
set fnord "$@" --quiet
|
|
||||||
shift # fnord
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # "$arg"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" | \
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
dashXmstdout)
|
|
||||||
# This case only exists to satisfy depend.m4. It is never actually
|
|
||||||
# run, as this mode is specially recognized in the preamble.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
makedepend)
|
|
||||||
# X makedepend
|
|
||||||
(
|
|
||||||
shift
|
|
||||||
cleared=no
|
|
||||||
for arg in "$@"; do
|
|
||||||
case $cleared in no)
|
|
||||||
set ""; shift
|
|
||||||
cleared=yes
|
|
||||||
esac
|
|
||||||
case "$arg" in
|
|
||||||
-D*|-I*)
|
|
||||||
set fnord "$@" "$arg"; shift;;
|
|
||||||
-*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"; shift;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
|
||||||
touch "$tmpdepfile"
|
|
||||||
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
|
||||||
tail +3 "$tmpdepfile" | tr ' ' '
|
|
||||||
' | \
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
|
||||||
;;
|
|
||||||
|
|
||||||
cpp)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the proprocessed file to stdout, regardless of -o,
|
|
||||||
# because we must use -o when running libtool.
|
|
||||||
( IFS=" "
|
|
||||||
case " $* " in
|
|
||||||
*" --mode=compile "*)
|
|
||||||
for arg
|
|
||||||
do # cycle over the arguments
|
|
||||||
case $arg in
|
|
||||||
"--mode=compile")
|
|
||||||
# insert --quiet before "--mode=compile"
|
|
||||||
set fnord "$@" --quiet
|
|
||||||
shift # fnord
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # "$arg"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"$@" -E |
|
|
||||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
|
||||||
sed '$ s: \\$::' > "$tmpdepfile"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
cat < "$tmpdepfile" >> "$depfile"
|
|
||||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvisualcpp)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the proprocessed file to stdout, regardless of -o,
|
|
||||||
# because we must use -o when running libtool.
|
|
||||||
( IFS=" "
|
|
||||||
case " $* " in
|
|
||||||
*" --mode=compile "*)
|
|
||||||
for arg
|
|
||||||
do # cycle over the arguments
|
|
||||||
case $arg in
|
|
||||||
"--mode=compile")
|
|
||||||
# insert --quiet before "--mode=compile"
|
|
||||||
set fnord "$@" --quiet
|
|
||||||
shift # fnord
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # "$arg"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"$@" -E |
|
|
||||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
|
||||||
echo " " >> "$depfile"
|
|
||||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
none)
|
|
||||||
exec "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Unknown depmode $depmode" 1>&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,251 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# install - install a program, script, or datafile
|
|
||||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
|
||||||
#
|
|
||||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
# documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
# the above copyright notice appear in all copies and that both that
|
|
||||||
# copyright notice and this permission notice appear in supporting
|
|
||||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
|
||||||
# publicity pertaining to distribution of the software without specific,
|
|
||||||
# written prior permission. M.I.T. makes no representations about the
|
|
||||||
# suitability of this software for any purpose. It is provided "as is"
|
|
||||||
# without express or implied warranty.
|
|
||||||
#
|
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
|
||||||
# `make' implicit rules from creating a file called install from it
|
|
||||||
# when there is no Makefile.
|
|
||||||
#
|
|
||||||
# This script is compatible with the BSD install script, but was written
|
|
||||||
# from scratch. It can only install one file at a time, a restriction
|
|
||||||
# shared with many OS's install programs.
|
|
||||||
|
|
||||||
|
|
||||||
# set DOITPROG to echo to test this script
|
|
||||||
|
|
||||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
|
||||||
doit="${DOITPROG-}"
|
|
||||||
|
|
||||||
|
|
||||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
|
||||||
|
|
||||||
mvprog="${MVPROG-mv}"
|
|
||||||
cpprog="${CPPROG-cp}"
|
|
||||||
chmodprog="${CHMODPROG-chmod}"
|
|
||||||
chownprog="${CHOWNPROG-chown}"
|
|
||||||
chgrpprog="${CHGRPPROG-chgrp}"
|
|
||||||
stripprog="${STRIPPROG-strip}"
|
|
||||||
rmprog="${RMPROG-rm}"
|
|
||||||
mkdirprog="${MKDIRPROG-mkdir}"
|
|
||||||
|
|
||||||
transformbasename=""
|
|
||||||
transform_arg=""
|
|
||||||
instcmd="$mvprog"
|
|
||||||
chmodcmd="$chmodprog 0755"
|
|
||||||
chowncmd=""
|
|
||||||
chgrpcmd=""
|
|
||||||
stripcmd=""
|
|
||||||
rmcmd="$rmprog -f"
|
|
||||||
mvcmd="$mvprog"
|
|
||||||
src=""
|
|
||||||
dst=""
|
|
||||||
dir_arg=""
|
|
||||||
|
|
||||||
while [ x"$1" != x ]; do
|
|
||||||
case $1 in
|
|
||||||
-c) instcmd="$cpprog"
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-d) dir_arg=true
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-m) chmodcmd="$chmodprog $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-o) chowncmd="$chownprog $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-g) chgrpcmd="$chgrpprog $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-s) stripcmd="$stripprog"
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
*) if [ x"$src" = x ]
|
|
||||||
then
|
|
||||||
src=$1
|
|
||||||
else
|
|
||||||
# this colon is to work around a 386BSD /bin/sh bug
|
|
||||||
:
|
|
||||||
dst=$1
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ x"$src" = x ]
|
|
||||||
then
|
|
||||||
echo "install: no input file specified"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ x"$dir_arg" != x ]; then
|
|
||||||
dst=$src
|
|
||||||
src=""
|
|
||||||
|
|
||||||
if [ -d $dst ]; then
|
|
||||||
instcmd=:
|
|
||||||
chmodcmd=""
|
|
||||||
else
|
|
||||||
instcmd=mkdir
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
|
|
||||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
|
||||||
# might cause directories to be created, which would be especially bad
|
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
|
||||||
|
|
||||||
if [ -f $src -o -d $src ]
|
|
||||||
then
|
|
||||||
true
|
|
||||||
else
|
|
||||||
echo "install: $src does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ x"$dst" = x ]
|
|
||||||
then
|
|
||||||
echo "install: no destination specified"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If destination is a directory, append the input filename; if your system
|
|
||||||
# does not like double slashes in filenames, you may need to add some logic
|
|
||||||
|
|
||||||
if [ -d $dst ]
|
|
||||||
then
|
|
||||||
dst="$dst"/`basename $src`
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
## this sed command emulates the dirname command
|
|
||||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
|
||||||
|
|
||||||
# Make sure that the destination directory exists.
|
|
||||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
|
||||||
|
|
||||||
# Skip lots of stat calls in the usual case.
|
|
||||||
if [ ! -d "$dstdir" ]; then
|
|
||||||
defaultIFS='
|
|
||||||
'
|
|
||||||
IFS="${IFS-${defaultIFS}}"
|
|
||||||
|
|
||||||
oIFS="${IFS}"
|
|
||||||
# Some sh's can't handle IFS=/ for some reason.
|
|
||||||
IFS='%'
|
|
||||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
|
||||||
IFS="${oIFS}"
|
|
||||||
|
|
||||||
pathcomp=''
|
|
||||||
|
|
||||||
while [ $# -ne 0 ] ; do
|
|
||||||
pathcomp="${pathcomp}${1}"
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [ ! -d "${pathcomp}" ] ;
|
|
||||||
then
|
|
||||||
$mkdirprog "${pathcomp}"
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
pathcomp="${pathcomp}/"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ x"$dir_arg" != x ]
|
|
||||||
then
|
|
||||||
$doit $instcmd $dst &&
|
|
||||||
|
|
||||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
|
||||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
|
||||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
|
||||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
|
||||||
else
|
|
||||||
|
|
||||||
# If we're going to rename the final executable, determine the name now.
|
|
||||||
|
|
||||||
if [ x"$transformarg" = x ]
|
|
||||||
then
|
|
||||||
dstfile=`basename $dst`
|
|
||||||
else
|
|
||||||
dstfile=`basename $dst $transformbasename |
|
|
||||||
sed $transformarg`$transformbasename
|
|
||||||
fi
|
|
||||||
|
|
||||||
# don't allow the sed command to completely eliminate the filename
|
|
||||||
|
|
||||||
if [ x"$dstfile" = x ]
|
|
||||||
then
|
|
||||||
dstfile=`basename $dst`
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make a temp file name in the proper directory.
|
|
||||||
|
|
||||||
dsttmp=$dstdir/#inst.$$#
|
|
||||||
|
|
||||||
# Move or copy the file name to the temp name
|
|
||||||
|
|
||||||
$doit $instcmd $src $dsttmp &&
|
|
||||||
|
|
||||||
trap "rm -f ${dsttmp}" 0 &&
|
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits
|
|
||||||
|
|
||||||
# If any of these fail, we abort the whole thing. If we want to
|
|
||||||
# ignore errors from any of these, just make sure not to ignore
|
|
||||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
|
||||||
|
|
||||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
|
||||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
|
||||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
|
||||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
|
||||||
|
|
||||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
|
||||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
|
||||||
|
|
||||||
fi &&
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,283 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Common stub for a few missing GNU programs while installing.
|
|
||||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
|
||||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
echo 1>&2 "Try \`$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
run=:
|
|
||||||
|
|
||||||
# In the cases where this matters, `missing' is being run in the
|
|
||||||
# srcdir already.
|
|
||||||
if test -f configure.ac; then
|
|
||||||
configure_ac=configure.ac
|
|
||||||
else
|
|
||||||
configure_ac=configure.in
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
--run)
|
|
||||||
# Try to run requested program, and just exit if it succeeds.
|
|
||||||
run=
|
|
||||||
shift
|
|
||||||
"$@" && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If it does not exist, or fails to run (possibly an outdated version),
|
|
||||||
# try to emulate it.
|
|
||||||
case "$1" in
|
|
||||||
|
|
||||||
-h|--h|--he|--hel|--help)
|
|
||||||
echo "\
|
|
||||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
|
||||||
|
|
||||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
|
||||||
error status if there is no known handling for PROGRAM.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help display this help and exit
|
|
||||||
-v, --version output version information and exit
|
|
||||||
--run try to run the given command, and emulate it if it fails
|
|
||||||
|
|
||||||
Supported PROGRAM values:
|
|
||||||
aclocal touch file \`aclocal.m4'
|
|
||||||
autoconf touch file \`configure'
|
|
||||||
autoheader touch file \`config.h.in'
|
|
||||||
automake touch all \`Makefile.in' files
|
|
||||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
|
||||||
flex create \`lex.yy.c', if possible, from existing .c
|
|
||||||
help2man touch the output file
|
|
||||||
lex create \`lex.yy.c', if possible, from existing .c
|
|
||||||
makeinfo touch the output file
|
|
||||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
|
||||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
|
||||||
echo "missing 0.3 - GNU automake"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-*)
|
|
||||||
echo 1>&2 "$0: Unknown \`$1' option"
|
|
||||||
echo 1>&2 "Try \`$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
aclocal)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
|
||||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
|
||||||
any GNU archive site."
|
|
||||||
touch aclocal.m4
|
|
||||||
;;
|
|
||||||
|
|
||||||
autoconf)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`${configure_ac}'. You might want to install the
|
|
||||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
|
||||||
archive site."
|
|
||||||
touch configure
|
|
||||||
;;
|
|
||||||
|
|
||||||
autoheader)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
|
||||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
|
||||||
from any GNU archive site."
|
|
||||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
|
||||||
test -z "$files" && files="config.h"
|
|
||||||
touch_files=
|
|
||||||
for f in $files; do
|
|
||||||
case "$f" in
|
|
||||||
*:*) touch_files="$touch_files "`echo "$f" |
|
|
||||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
|
||||||
*) touch_files="$touch_files $f.in";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
touch $touch_files
|
|
||||||
;;
|
|
||||||
|
|
||||||
automake)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
|
||||||
You might want to install the \`Automake' and \`Perl' packages.
|
|
||||||
Grab them from any GNU archive site."
|
|
||||||
find . -type f -name Makefile.am -print |
|
|
||||||
sed 's/\.am$/.in/' |
|
|
||||||
while read f; do touch "$f"; done
|
|
||||||
;;
|
|
||||||
|
|
||||||
bison|yacc)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.y' file. You may need the \`Bison' package
|
|
||||||
in order for those modifications to take effect. You can get
|
|
||||||
\`Bison' from any GNU archive site."
|
|
||||||
rm -f y.tab.c y.tab.h
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
eval LASTARG="\${$#}"
|
|
||||||
case "$LASTARG" in
|
|
||||||
*.y)
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" y.tab.c
|
|
||||||
fi
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" y.tab.h
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ ! -f y.tab.h ]; then
|
|
||||||
echo >y.tab.h
|
|
||||||
fi
|
|
||||||
if [ ! -f y.tab.c ]; then
|
|
||||||
echo 'main() { return 0; }' >y.tab.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
lex|flex)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.l' file. You may need the \`Flex' package
|
|
||||||
in order for those modifications to take effect. You can get
|
|
||||||
\`Flex' from any GNU archive site."
|
|
||||||
rm -f lex.yy.c
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
eval LASTARG="\${$#}"
|
|
||||||
case "$LASTARG" in
|
|
||||||
*.l)
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" lex.yy.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ ! -f lex.yy.c ]; then
|
|
||||||
echo 'main() { return 0; }' >lex.yy.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
help2man)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a dependency of a manual page. You may need the
|
|
||||||
\`Help2man' package in order for those modifications to take
|
|
||||||
effect. You can get \`Help2man' from any GNU archive site."
|
|
||||||
|
|
||||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
|
||||||
if test -z "$file"; then
|
|
||||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
|
||||||
fi
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
touch $file
|
|
||||||
else
|
|
||||||
test -z "$file" || exec >$file
|
|
||||||
echo ".ab help2man is required to generate this page"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
makeinfo)
|
|
||||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
|
||||||
# We have makeinfo, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
|
||||||
indirectly affecting the aspect of the manual. The spurious
|
|
||||||
call might also be the consequence of using a buggy \`make' (AIX,
|
|
||||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
|
||||||
the \`GNU make' package. Grab either from any GNU archive site."
|
|
||||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
|
||||||
if test -z "$file"; then
|
|
||||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
|
||||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
|
||||||
fi
|
|
||||||
touch $file
|
|
||||||
;;
|
|
||||||
|
|
||||||
tar)
|
|
||||||
shift
|
|
||||||
if test -n "$run"; then
|
|
||||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We have already tried tar in the generic part.
|
|
||||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
|
||||||
# messages.
|
|
||||||
if (gnutar --version > /dev/null 2>&1); then
|
|
||||||
gnutar ${1+"$@"} && exit 0
|
|
||||||
fi
|
|
||||||
if (gtar --version > /dev/null 2>&1); then
|
|
||||||
gtar ${1+"$@"} && exit 0
|
|
||||||
fi
|
|
||||||
firstarg="$1"
|
|
||||||
if shift; then
|
|
||||||
case "$firstarg" in
|
|
||||||
*o*)
|
|
||||||
firstarg=`echo "$firstarg" | sed s/o//`
|
|
||||||
tar "$firstarg" ${1+"$@"} && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case "$firstarg" in
|
|
||||||
*h*)
|
|
||||||
firstarg=`echo "$firstarg" | sed s/h//`
|
|
||||||
tar "$firstarg" ${1+"$@"} && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
|
||||||
You may want to install GNU tar or Free paxutils, or check the
|
|
||||||
command line arguments."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
|
||||||
system. You might have modified some files without having the
|
|
||||||
proper tools for further handling them. Check the \`README' file,
|
|
||||||
it often tells you about the needed prerequirements for installing
|
|
||||||
this package. You may also peek at any GNU archive site, in case
|
|
||||||
some other package would contain this missing \`$1' program."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,40 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# mkinstalldirs --- make directory hierarchy
|
|
||||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
|
||||||
# Created: 1993-05-16
|
|
||||||
# Public domain
|
|
||||||
|
|
||||||
# $Id: mkinstalldirs,v 1.1 2003/04/03 18:13:41 mes5k Exp $
|
|
||||||
|
|
||||||
errstatus=0
|
|
||||||
|
|
||||||
for file
|
|
||||||
do
|
|
||||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
|
||||||
shift
|
|
||||||
|
|
||||||
pathcomp=
|
|
||||||
for d
|
|
||||||
do
|
|
||||||
pathcomp="$pathcomp$d"
|
|
||||||
case "$pathcomp" in
|
|
||||||
-* ) pathcomp=./$pathcomp ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test ! -d "$pathcomp"; then
|
|
||||||
echo "mkdir $pathcomp"
|
|
||||||
|
|
||||||
mkdir "$pathcomp" || lasterr=$?
|
|
||||||
|
|
||||||
if test ! -d "$pathcomp"; then
|
|
||||||
errstatus=$lasterr
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
pathcomp="$pathcomp/"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $errstatus
|
|
||||||
|
|
||||||
# mkinstalldirs ends here
|
|
@ -1,153 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# test-driver - basic testsuite driver script.
|
|
||||||
|
|
||||||
scriptversion=2018-03-07.03; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 2011-2021 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# This file is maintained in Automake, please report
|
|
||||||
# bugs to <bug-automake@gnu.org> or send patches to
|
|
||||||
# <automake-patches@gnu.org>.
|
|
||||||
|
|
||||||
# Make unconditional expansion of undefined variables an error. This
|
|
||||||
# helps a lot in preventing typo-related bugs.
|
|
||||||
set -u
|
|
||||||
|
|
||||||
usage_error ()
|
|
||||||
{
|
|
||||||
echo "$0: $*" >&2
|
|
||||||
print_usage >&2
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
print_usage ()
|
|
||||||
{
|
|
||||||
cat <<END
|
|
||||||
Usage:
|
|
||||||
test-driver --test-name NAME --log-file PATH --trs-file PATH
|
|
||||||
[--expect-failure {yes|no}] [--color-tests {yes|no}]
|
|
||||||
[--enable-hard-errors {yes|no}] [--]
|
|
||||||
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
|
|
||||||
|
|
||||||
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
|
|
||||||
See the GNU Automake documentation for information.
|
|
||||||
END
|
|
||||||
}
|
|
||||||
|
|
||||||
test_name= # Used for reporting.
|
|
||||||
log_file= # Where to save the output of the test script.
|
|
||||||
trs_file= # Where to save the metadata of the test run.
|
|
||||||
expect_failure=no
|
|
||||||
color_tests=no
|
|
||||||
enable_hard_errors=yes
|
|
||||||
while test $# -gt 0; do
|
|
||||||
case $1 in
|
|
||||||
--help) print_usage; exit $?;;
|
|
||||||
--version) echo "test-driver $scriptversion"; exit $?;;
|
|
||||||
--test-name) test_name=$2; shift;;
|
|
||||||
--log-file) log_file=$2; shift;;
|
|
||||||
--trs-file) trs_file=$2; shift;;
|
|
||||||
--color-tests) color_tests=$2; shift;;
|
|
||||||
--expect-failure) expect_failure=$2; shift;;
|
|
||||||
--enable-hard-errors) enable_hard_errors=$2; shift;;
|
|
||||||
--) shift; break;;
|
|
||||||
-*) usage_error "invalid option: '$1'";;
|
|
||||||
*) break;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
missing_opts=
|
|
||||||
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
|
|
||||||
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
|
|
||||||
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
|
|
||||||
if test x"$missing_opts" != x; then
|
|
||||||
usage_error "the following mandatory options are missing:$missing_opts"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
usage_error "missing argument"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $color_tests = yes; then
|
|
||||||
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
|
|
||||||
red='[0;31m' # Red.
|
|
||||||
grn='[0;32m' # Green.
|
|
||||||
lgn='[1;32m' # Light green.
|
|
||||||
blu='[1;34m' # Blue.
|
|
||||||
mgn='[0;35m' # Magenta.
|
|
||||||
std='[m' # No color.
|
|
||||||
else
|
|
||||||
red= grn= lgn= blu= mgn= std=
|
|
||||||
fi
|
|
||||||
|
|
||||||
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
|
|
||||||
trap "st=129; $do_exit" 1
|
|
||||||
trap "st=130; $do_exit" 2
|
|
||||||
trap "st=141; $do_exit" 13
|
|
||||||
trap "st=143; $do_exit" 15
|
|
||||||
|
|
||||||
# Test script is run here. We create the file first, then append to it,
|
|
||||||
# to ameliorate tests themselves also writing to the log file. Our tests
|
|
||||||
# don't, but others can (automake bug#35762).
|
|
||||||
: >"$log_file"
|
|
||||||
"$@" >>"$log_file" 2>&1
|
|
||||||
estatus=$?
|
|
||||||
|
|
||||||
if test $enable_hard_errors = no && test $estatus -eq 99; then
|
|
||||||
tweaked_estatus=1
|
|
||||||
else
|
|
||||||
tweaked_estatus=$estatus
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $tweaked_estatus:$expect_failure in
|
|
||||||
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
|
|
||||||
0:*) col=$grn res=PASS recheck=no gcopy=no;;
|
|
||||||
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
|
|
||||||
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
|
|
||||||
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
|
|
||||||
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Report the test outcome and exit status in the logs, so that one can
|
|
||||||
# know whether the test passed or failed simply by looking at the '.log'
|
|
||||||
# file, without the need of also peaking into the corresponding '.trs'
|
|
||||||
# file (automake bug#11814).
|
|
||||||
echo "$res $test_name (exit status: $estatus)" >>"$log_file"
|
|
||||||
|
|
||||||
# Report outcome to console.
|
|
||||||
echo "${col}${res}${std}: $test_name"
|
|
||||||
|
|
||||||
# Register the test result, and other relevant metadata.
|
|
||||||
echo ":test-result: $res" > $trs_file
|
|
||||||
echo ":global-test-result: $res" >> $trs_file
|
|
||||||
echo ":recheck: $recheck" >> $trs_file
|
|
||||||
echo ":copy-in-global-log: $gcopy" >> $trs_file
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
5687
src/tclap-1.2.5/configure
vendored
5687
src/tclap-1.2.5/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,33 +0,0 @@
|
|||||||
AC_INIT([tclap],[1.2.5])
|
|
||||||
AC_CONFIG_AUX_DIR(config)
|
|
||||||
AC_CONFIG_SRCDIR([examples/test1.cpp])
|
|
||||||
AM_CONFIG_HEADER(config/config.h)
|
|
||||||
AM_INIT_AUTOMAKE
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_CXX_HAVE_SSTREAM
|
|
||||||
AC_CXX_HAVE_STRSTREAM
|
|
||||||
AC_CXX_HAVE_LONG_LONG
|
|
||||||
AC_CHECK_PROG(DOT,dot,YES,NO)
|
|
||||||
AC_PROG_RANLIB
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
BB_ENABLE_DOXYGEN
|
|
||||||
|
|
||||||
HAVE_WARN_EFFECTIVE_CXX
|
|
||||||
CXXFLAGS="$CXXFLAGS $WARN_EFFECTIVE_CXX"
|
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_GNU_COMPILERS], [test x$ac_cv_cxx_compiler_gnu = xyes])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([ Makefile \
|
|
||||||
tclap.pc \
|
|
||||||
examples/Makefile \
|
|
||||||
include/Makefile \
|
|
||||||
include/tclap/Makefile \
|
|
||||||
config/Makefile \
|
|
||||||
docs/Makefile \
|
|
||||||
docs/Doxyfile \
|
|
||||||
msc/Makefile \
|
|
||||||
msc/examples/Makefile \
|
|
||||||
tests/Makefile])
|
|
||||||
AC_CONFIG_COMMANDS([default],[\
|
|
||||||
chmod a+x $ac_top_srcdir/tests/*.sh],[])
|
|
||||||
AC_OUTPUT
|
|
File diff suppressed because it is too large
Load Diff
@ -1,35 +0,0 @@
|
|||||||
.NOTPARALLEL:
|
|
||||||
|
|
||||||
if DOC
|
|
||||||
|
|
||||||
all:
|
|
||||||
@DOXYGEN@ Doxyfile
|
|
||||||
|
|
||||||
manual: manual.xml
|
|
||||||
xsltproc -o $(abs_builddir)/manual.html --stringparam html.stylesheet style.css /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl $(abs_srcdir)/manual.xml
|
|
||||||
else
|
|
||||||
|
|
||||||
all:
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST = manual.xml
|
|
||||||
dist_doc_DATA = index.html manual.html style.css
|
|
||||||
docdir = ${datadir}/doc/${PACKAGE}
|
|
||||||
|
|
||||||
install-data-local :
|
|
||||||
$(mkdir_p) $(DESTDIR)$(docdir)
|
|
||||||
cp -R html $(DESTDIR)$(docdir)
|
|
||||||
|
|
||||||
uninstall-local :
|
|
||||||
chmod -R o+w $(DESTDIR)$(docdir)/html
|
|
||||||
rm -rf $(DESTDIR)$(docdir)/html
|
|
||||||
|
|
||||||
dist-hook :
|
|
||||||
$(mkdir_p) $(distdir)
|
|
||||||
cp -R $(abs_builddir)/html $(distdir)
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
$(RM) -rf $(abs_builddir)/html/*
|
|
||||||
$(RM) -rf $(abs_builddir)/doxygen_sqlite3.db
|
|
||||||
|
|
@ -1,498 +0,0 @@
|
|||||||
# 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 = docs
|
|
||||||
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 $(dist_doc_DATA) \
|
|
||||||
$(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
|
||||||
CONFIG_CLEAN_FILES = Doxyfile
|
|
||||||
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)$(docdir)"
|
|
||||||
DATA = $(dist_doc_DATA)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in \
|
|
||||||
$(top_srcdir)/config/mkinstalldirs README
|
|
||||||
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 = ${datadir}/doc/${PACKAGE}
|
|
||||||
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@
|
|
||||||
EXTRA_DIST = manual.xml
|
|
||||||
dist_doc_DATA = index.html manual.html style.css
|
|
||||||
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 docs/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu docs/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):
|
|
||||||
Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
|
||||||
install-dist_docDATA: $(dist_doc_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(docdir)" || 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_DATA) $$files '$(DESTDIR)$(docdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-dist_docDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
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
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
|
||||||
dist-hook
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(DATA)
|
|
||||||
installdirs:
|
|
||||||
for dir in "$(DESTDIR)$(docdir)"; 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 clean-local mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-data-local install-dist_docDATA
|
|
||||||
|
|
||||||
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-dist_docDATA uninstall-local
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-local \
|
|
||||||
cscopelist-am ctags-am dist-hook distclean distclean-generic \
|
|
||||||
distdir dvi dvi-am html html-am info info-am install \
|
|
||||||
install-am install-data install-data-am install-data-local \
|
|
||||||
install-dist_docDATA install-dvi install-dvi-am install-exec \
|
|
||||||
install-exec-am install-html install-html-am install-info \
|
|
||||||
install-info-am 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-am uninstall uninstall-am \
|
|
||||||
uninstall-dist_docDATA uninstall-local
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
.NOTPARALLEL:
|
|
||||||
|
|
||||||
@DOC_TRUE@all:
|
|
||||||
@DOC_TRUE@ @DOXYGEN@ Doxyfile
|
|
||||||
|
|
||||||
@DOC_TRUE@manual: manual.xml
|
|
||||||
@DOC_TRUE@ xsltproc -o $(abs_builddir)/manual.html --stringparam html.stylesheet style.css /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl $(abs_srcdir)/manual.xml
|
|
||||||
|
|
||||||
@DOC_FALSE@all:
|
|
||||||
|
|
||||||
install-data-local :
|
|
||||||
$(mkdir_p) $(DESTDIR)$(docdir)
|
|
||||||
cp -R html $(DESTDIR)$(docdir)
|
|
||||||
|
|
||||||
uninstall-local :
|
|
||||||
chmod -R o+w $(DESTDIR)$(docdir)/html
|
|
||||||
rm -rf $(DESTDIR)$(docdir)/html
|
|
||||||
|
|
||||||
dist-hook :
|
|
||||||
$(mkdir_p) $(distdir)
|
|
||||||
cp -R $(abs_builddir)/html $(distdir)
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
$(RM) -rf $(abs_builddir)/html/*
|
|
||||||
$(RM) -rf $(abs_builddir)/doxygen_sqlite3.db
|
|
||||||
|
|
||||||
# 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:
|
|
@ -1,5 +0,0 @@
|
|||||||
|
|
||||||
To generate the manual from the docbook xml you need and xslt processor
|
|
||||||
and an xsl file that defines the output. For example:
|
|
||||||
|
|
||||||
xsltproc --stringparam html.stylesheet style.css /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl manual.xml > manual.html
|
|
@ -1,109 +0,0 @@
|
|||||||
<!--
|
|
||||||
-
|
|
||||||
- file: index.html
|
|
||||||
-
|
|
||||||
- Copyright (c) 2003,2006 Michael E. Smoot .
|
|
||||||
- All rights reverved.
|
|
||||||
-
|
|
||||||
- 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,
|
|
||||||
- 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.
|
|
||||||
-
|
|
||||||
-->
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta name="generator" content=
|
|
||||||
"HTML Tidy for Mac OS X (vers 1st August 2004), see www.w3.org" />
|
|
||||||
<title>tclap -- Templatized C++ Command Line Parser Library</title>
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<table summary="Title and Sourceforge logo.">
|
|
||||||
<tr>
|
|
||||||
<td align="left">
|
|
||||||
<h1>Templatized C++ Command Line Parser Library</h1>
|
|
||||||
</td>
|
|
||||||
<td align="right">
|
|
||||||
<a href="http://sourceforge.net/projects/tclap"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=76645&type=15" width="150" height="40" alt="Get Templatized C++ Command Line Parser at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div class="links">
|
|
||||||
<h3>Links</h3>
|
|
||||||
<ul class="menu">
|
|
||||||
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=76645">Download</a> the source</li><br/>
|
|
||||||
<li>Read the <a href="manual.html">Manual</a></li><br/>
|
|
||||||
<li>Read the <a href="html/index.html">API documentation</a></li><br/>
|
|
||||||
<li>Visit the
|
|
||||||
<a href="http://sourceforge.net/projects/tclap/">SourceForge project page</a></li><br/>
|
|
||||||
<li>Send <a href="https://sourceforge.net/p/tclap/_list/tickets">feedback, comments, patches, etc.</a></li></br>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>Branch 1.2</h3>
|
|
||||||
Windows <img src="https://dev.azure.com/danielaarno/tclap/_apis/build/status/tclap-CI-WIN%20(1.2)"
|
|
||||||
alt="Windows build status"><br>
|
|
||||||
|
|
||||||
Linux <img src="https://dev.azure.com/danielaarno/tclap/_apis/build/status/tclap-CI%20(1.2)"
|
|
||||||
alt="Linux build status"><br>
|
|
||||||
|
|
||||||
Mac <img src="https://dev.azure.com/danielaarno/tclap/_apis/build/status/tclap-CI-Mac%20(1.2)"
|
|
||||||
alt="Mac build status"><br>
|
|
||||||
</div>
|
|
||||||
<div class="main">
|
|
||||||
|
|
||||||
<p style="background-color:powderblue;">
|
|
||||||
<b>NOTE: </b>The current development version of TCLAP
|
|
||||||
is <A HREF="http://tclap.sourceforge.net/index.html">1.4</a>,
|
|
||||||
it is recommended for use by new projects.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<em>TCLAP</em> is a small, flexible library that provides a simple interface for
|
|
||||||
defining and accessing command line arguments. It was initially
|
|
||||||
inspired by the user friendly <a href=
|
|
||||||
"http://www.cs.bgu.ac.il/~cgproj/CLAP/">CLAP</a> library. The
|
|
||||||
difference is that this library is templatized, so the argument
|
|
||||||
class is type independent. Type independence avoids identical-except-for-type
|
|
||||||
objects, such as IntArg, FloatArg, and StringArg. While the library is
|
|
||||||
not strictly compliant with the GNU or POSIX standards, it is
|
|
||||||
close.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<em>TCLAP</em> is written in ANSI C++ and is meant to be compatible with any
|
|
||||||
standards-compliant C++ compiler. It is known to work on Linux, MacOS X,
|
|
||||||
Windows, and Solaris platforms. The library is implemented
|
|
||||||
entirely in header files making it easy to use and distribute with other
|
|
||||||
software. It is licensed under the
|
|
||||||
<a href="http://opensource.org/licenses/mit-license.php">MIT License</a>
|
|
||||||
for worry free distribution.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<em>TCLAP</em> is now a mature, stable, and feature rich package.
|
|
||||||
Unless I get <i>really</i> bored, it probably won't see much further
|
|
||||||
development aside from bug fixes and compatibility updates.
|
|
||||||
Please don't let any apparent project inactivity discourage you
|
|
||||||
from using the software!
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Don't hesitate to <a href="https://sourceforge.net/p/tclap/_list/tickets">
|
|
||||||
send us your feedback</a>!
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<em>Happy coding!</em>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,984 +0,0 @@
|
|||||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Templatized C++ Command Line Parser Manual</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"><div class="titlepage"><div><div><h1 class="title"><a name="idm1"></a>Templatized C++ Command Line Parser Manual</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Michael</span> <span class="othername">E</span> <span class="surname">Smoot</span></h3></div></div><div><p class="copyright">Copyright © 2003,2004,2005,2006,2009,2011,2012 Michael E. Smoot</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="chapter"><a href="#BASIC_USAGE">1. Basic Usage</a></span></dt><dd><dl><dt><span class="sect1"><a href="#OVERVIEW">Overview</a></span></dt><dt><span class="sect1"><a href="#EXAMPLE">Example</a></span></dt><dd><dl><dt><span class="sect2"><a href="#LIBRARY_PROPERTIES">Library Properties</a></span></dt><dt><span class="sect2"><a href="#ARG_PROPERTIES">Common Argument Properties</a></span></dt></dl></dd><dt><span class="sect1"><a href="#COMPILING">Compiling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#FUNDAMENTAL_CLASSES">2. Fundamental Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="#COMMAND_LINE"><code class="classname">CmdLine</code></a></span></dt><dt><span class="sect1"><a href="#SWITCH_ARG"><code class="classname">SwitchArg</code></a></span></dt><dt><span class="sect1"><a href="#VALUE_ARG"><code class="classname">ValueArg</code></a></span></dt><dt><span class="sect1"><a href="#MULTI_ARG"><code class="classname">MultiArg</code></a></span></dt><dt><span class="sect1"><a href="#MULTI_SWITCH_ARG"><code class="classname">MultiSwitchArg</code></a></span></dt><dt><span class="sect1"><a href="#UNLABELED_VALUE_ARG"><code class="classname">UnlabeledValueArg</code></a></span></dt><dt><span class="sect1"><a href="#UNLABELED_MULTI_ARG"><code class="classname">UnlabeledMultiArg</code></a></span></dt></dl></dd><dt><span class="chapter"><a href="#COMPLICATIONS">3. Complications</a></span></dt><dd><dl><dt><span class="sect1"><a href="#COMBINE_SWITCHES">I want to combine multiple switches into one argument...</a></span></dt><dt><span class="sect1"><a href="#XOR">I want one argument or the other, but not both...</a></span></dt><dt><span class="sect1"><a href="#NO_FLAG">I have more arguments than single flags make sense for...</a></span></dt><dt><span class="sect1"><a href="#CONSTRAINT">I want to constrain the values allowed for a particular
|
|
||||||
argument...</a></span></dt><dt><span class="sect1"><a href="#ARG_ADD_CMDLINE">I want the Args to add themselves to the CmdLine...</a></span></dt><dt><span class="sect1"><a href="#CHANGE_OUTPUT">I want different output than what is provided...</a></span></dt><dt><span class="sect1"><a href="#NO_HELP_VERSION">I don't want the --help and --version switches to be created automatically...</a></span></dt><dt><span class="sect1"><a href="#IGNORE_ARGS">I want to ignore certain arguments...</a></span></dt><dt><span class="sect1"><a href="#IGNORE_UNMATCHED">I want to ignore unmatched arguments...</a></span></dt><dt><span class="sect1"><a href="#READING_HEX_INTEGERS">I want to read hex integers as arguments...</a></span></dt><dt><span class="sect1"><a href="#USING_ARGTRAITS">I want to use different types...</a></span></dt><dt><span class="sect1"><a href="#CHANGING_STARTSTRINGS">I want to use Windows-style flags like "/x" and "/y"...</a></span></dt></dl></dd><dt><span class="chapter"><a href="#NOTES">4. Notes</a></span></dt><dd><dl><dt><span class="sect1"><a href="#DESCRIPTION_EXCEPTIONS">Type Descriptions</a></span></dt><dt><span class="sect1"><a href="#VISITORS">Visitors</a></span></dt><dt><span class="sect1"><a href="#MORE_INFO">More Information</a></span></dt></dl></dd></dl></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="BASIC_USAGE"></a>Chapter 1. Basic Usage</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="#OVERVIEW">Overview</a></span></dt><dt><span class="sect1"><a href="#EXAMPLE">Example</a></span></dt><dd><dl><dt><span class="sect2"><a href="#LIBRARY_PROPERTIES">Library Properties</a></span></dt><dt><span class="sect2"><a href="#ARG_PROPERTIES">Common Argument Properties</a></span></dt></dl></dd><dt><span class="sect1"><a href="#COMPILING">Compiling</a></span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="OVERVIEW"></a>Overview</h2></div></div></div><p>
|
|
||||||
<span class="emphasis"><em>TCLAP</em></span> has a few key classes to be aware of.
|
|
||||||
The first is the
|
|
||||||
<code class="classname">CmdLine</code> (command line) class. This class parses
|
|
||||||
the command line passed to it according to the arguments that it
|
|
||||||
contains. Arguments are separate objects that are added to the
|
|
||||||
<code class="classname">CmdLine</code> object one at a time. The six
|
|
||||||
argument classes are: <code class="classname">ValueArg</code>,
|
|
||||||
<code class="classname">UnlabeledValueArg</code>,
|
|
||||||
<code class="classname">SwitchArg</code>, <code class="classname">MultiSwitchArg</code>,
|
|
||||||
<code class="classname">MultiArg</code> and
|
|
||||||
<code class="classname">UnlabeledMultiArg</code>.
|
|
||||||
These classes are templatized, which means they can be defined to parse
|
|
||||||
a value of any <a class="link" href="#USING_ARGTRAITS" title="I want to use different types..."> type</a>. Once you add the
|
|
||||||
arguments to the <code class="classname">CmdLine</code> object, it parses the
|
|
||||||
command line
|
|
||||||
and assigns the data it finds to the specific argument objects it
|
|
||||||
contains. Your program accesses the values parsed by
|
|
||||||
calls to the <code class="methodname">getValue()</code> methods of the
|
|
||||||
argument objects.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="EXAMPLE"></a>Example</h2></div></div></div><p>
|
|
||||||
Here is a simple <a class="ulink" href="test1.cpp" target="_top"> example</a> ...
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <tclap/CmdLine.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object, and insert a message
|
|
||||||
// that describes the program. The "Command description message"
|
|
||||||
// is printed last in the help text. The second argument is the
|
|
||||||
// delimiter (usually space) and the last one is the version number.
|
|
||||||
// The CmdLine object parses the argv array based on the Arg objects
|
|
||||||
// that it contains.
|
|
||||||
TCLAP::CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
|
|
||||||
// Define a value argument and add it to the command line.
|
|
||||||
// A value arg defines a flag and a type of value that it expects,
|
|
||||||
// such as "-n Bishop".
|
|
||||||
TCLAP::ValueArg<std::string> nameArg("n","name","Name to print",true,"homer","string");
|
|
||||||
|
|
||||||
// Add the argument nameArg to the CmdLine object. The CmdLine object
|
|
||||||
// uses this Arg to parse the command line.
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
// Define a switch and add it to the command line.
|
|
||||||
// A switch arg is a boolean argument and only defines a flag that
|
|
||||||
// indicates true or false. In this example the SwitchArg adds itself
|
|
||||||
// to the CmdLine object as part of the constructor. This eliminates
|
|
||||||
// the need to call the cmd.add() method. All args have support in
|
|
||||||
// their constructors to add themselves directly to the CmdLine object.
|
|
||||||
// It doesn't matter which idiom you choose, they accomplish the same thing.
|
|
||||||
TCLAP::SwitchArg reverseSwitch("r","reverse","Print name backwards", cmd, false);
|
|
||||||
|
|
||||||
// Parse the argv array.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
// Get the value parsed by each arg.
|
|
||||||
std::string name = nameArg.getValue();
|
|
||||||
bool reverseName = reverseSwitch.getValue();
|
|
||||||
|
|
||||||
// Do what you intend.
|
|
||||||
if ( reverseName )
|
|
||||||
{
|
|
||||||
std::reverse(name.begin(),name.end());
|
|
||||||
std::cout << "My name (spelled backwards) is: " << name << std::endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
std::cout << "My name is: " << name << std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
} catch (TCLAP::ArgException &e) // catch exceptions
|
|
||||||
{ std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; }
|
|
||||||
}
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
The output should look like:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
% test1 -n mike
|
|
||||||
My name is: mike
|
|
||||||
|
|
||||||
% test1 -n mike -r
|
|
||||||
My name (spelled backwards) is: ekim
|
|
||||||
|
|
||||||
% test1 -r -n mike
|
|
||||||
My name (spelled backwards) is: ekim
|
|
||||||
|
|
||||||
% test1 -r
|
|
||||||
PARSE ERROR:
|
|
||||||
One or more required arguments missing!
|
|
||||||
|
|
||||||
Brief USAGE:
|
|
||||||
test1 [-r] -n <string> [--] [-v] [-h]
|
|
||||||
|
|
||||||
For complete USAGE and HELP type:
|
|
||||||
test1 --help
|
|
||||||
|
|
||||||
|
|
||||||
% test1 --help
|
|
||||||
|
|
||||||
USAGE:
|
|
||||||
|
|
||||||
test1 [-r] -n <string> [--] [-v] [-h]
|
|
||||||
|
|
||||||
|
|
||||||
Where:
|
|
||||||
|
|
||||||
-r, --reverse
|
|
||||||
Print name backwards
|
|
||||||
|
|
||||||
-n <string> --name <string>
|
|
||||||
(required) (value required) Name to print
|
|
||||||
|
|
||||||
--, --ignore_rest
|
|
||||||
Ignores the rest of the labeled arguments following this flag.
|
|
||||||
|
|
||||||
-v, --version
|
|
||||||
Displays version information and exits.
|
|
||||||
|
|
||||||
-h, --help
|
|
||||||
Displays usage information and exits.
|
|
||||||
|
|
||||||
|
|
||||||
Command description message
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="LIBRARY_PROPERTIES"></a>Library Properties</h3></div></div></div><p>
|
|
||||||
This example shows a number of different properties of the
|
|
||||||
library...
|
|
||||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Arguments can appear in any order (...mostly,
|
|
||||||
<a class="link" href="#COMPLICATIONS" title="Chapter 3. Complications"> more</a> on this later).</li><li class="listitem">The <em class="parameter"><code>help</code></em>, <em class="parameter"><code>version</code></em>
|
|
||||||
and <em class="parameter"><code>--</code></em><code class="classname">SwitchArg</code>s
|
|
||||||
are specified automatically. Using either the <em class="parameter"><code>-h</code></em> or
|
|
||||||
<em class="parameter"><code>--help</code></em> flag will cause the USAGE message to be displayed,
|
|
||||||
<em class="parameter"><code>-v</code></em> or <em class="parameter"><code>--version</code></em> will cause
|
|
||||||
any version information to
|
|
||||||
be displayed, and <em class="parameter"><code>--</code></em> or
|
|
||||||
<em class="parameter"><code>--ignore_rest</code></em> will cause the
|
|
||||||
remaining labeled arguments to be ignored. These switches are
|
|
||||||
included by default on every command line. You can disable this functionality if desired (although we don't recommend it).
|
|
||||||
How we generate the behavior behind these flags is described
|
|
||||||
<a class="link" href="#VISITORS" title="Visitors"> later</a>.
|
|
||||||
</li><li class="listitem">If there is an error parsing the command line (e.g. a required
|
|
||||||
argument isn't provided), the program exits and displays a brief
|
|
||||||
USAGE and an error message.</li><li class="listitem">The program name is assumed to always be argv[0], so it isn't
|
|
||||||
specified directly.</li><li class="listitem">A value delimiter character can be specified. This means that if you
|
|
||||||
prefer arguments of the style <em class="parameter"><code>-s=asdf</code></em> instead of
|
|
||||||
<em class="parameter"><code>-s asdf</code></em>, you can do so.</li><li class="listitem"><span class="emphasis"><em>Always wrap everything in a try block that catches
|
|
||||||
ArgExceptions!</em></span> Any problems found in constructing the
|
|
||||||
<code class="classname">CmdLine</code>, constructing the <code class="classname">Arg</code>s,
|
|
||||||
or parsing the command line will throw an
|
|
||||||
<code class="classname">ArgException</code>.</li></ul></div><p>
|
|
||||||
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="ARG_PROPERTIES"></a>Common Argument Properties</h3></div></div></div><p>
|
|
||||||
Arguments, whatever their type, have a few common properties.
|
|
||||||
These properties are set in the constructors of the arguments.
|
|
||||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">First is the flag or the character preceded by a dash(-) that
|
|
||||||
signals the beginning of the argument on the command line.</li><li class="listitem">Arguments also have names, which can also be used
|
|
||||||
as an alternative flag on the command line, this time preceded by two dashes
|
|
||||||
(--) [like the familiar <code class="function">getopt_long()</code>].</li><li class="listitem">Next is the description of the argument. This is a short
|
|
||||||
description of the argument displayed in the help/usage message
|
|
||||||
when needed.</li><li class="listitem">The following parameters in the constructors vary depending on
|
|
||||||
the type of argument. Some possible values include:
|
|
||||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem">A boolean value indicating whether the Arg is required or not. </li><li class="listitem">A default value.</li><li class="listitem">A <a class="link" href="#DESCRIPTION_EXCEPTIONS" title="Type Descriptions">description</a> of the type of value expected.</li><li class="listitem">A <a class="link" href="#CONSTRAINT" title="I want to constrain the values allowed for a particular argument...">constraint</a> on the value expected.</li><li class="listitem">The CmdLine instance that the Arg should be added to.</li><li class="listitem">A <a class="link" href="#VISITORS" title="Visitors">Visitor</a>.</li></ul></div></li><li class="listitem">See the <a class="ulink" href="html/index.html" target="_top">API Documentation</a> for more detail.</li></ul></div><p>
|
|
||||||
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="COMPILING"></a>Compiling</h2></div></div></div><p>
|
|
||||||
<span class="emphasis"><em>TCLAP</em></span> is implemented entirely in header files
|
|
||||||
which means you only need to include CmdLine.h to use the library.
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
#include <tclap/CmdLine.h>
|
|
||||||
</pre><p>
|
|
||||||
You'll need to make sure that your compiler can see the header
|
|
||||||
files. If you do the usual "make install" then your compiler should
|
|
||||||
see the files by default. Alternatively, you can use the -I
|
|
||||||
complier argument to specify the exact location of the libraries.
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
c++ -o my_program -I /some/place/tclap-1.X/include my_program.cpp
|
|
||||||
</pre><p>
|
|
||||||
Where /some/place/tclap-1.X is the place you have unpacked the
|
|
||||||
distribution.
|
|
||||||
</p><p>
|
|
||||||
Finally, if you want to include <span class="emphasis"><em>TCLAP</em></span> as part of
|
|
||||||
your software
|
|
||||||
(which is perfectly OK, even encouraged) then simply copy the
|
|
||||||
contents of /some/place/tclap-1.X/include (the tclap directory and
|
|
||||||
all of the header files it contains) into your include
|
|
||||||
directory. The necessary m4 macros for proper configuration are included
|
|
||||||
in the config directory.
|
|
||||||
</p><p>
|
|
||||||
<span class="emphasis"><em>TCLAP</em></span> was developed on Linux and MacOSX systems.
|
|
||||||
It is also known
|
|
||||||
to work on Windows, Sun and Alpha platforms. We've made every
|
|
||||||
effort to keep the library compliant with the ANSI C++ standard so
|
|
||||||
if your compiler meets the standard, then this library should work
|
|
||||||
for you. Please let us know if this is not the case!
|
|
||||||
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="WINDOWS_NOTE"></a>Windows Note</h3></div></div></div><p>
|
|
||||||
As we understand things, Visual C++ does not have the file
|
|
||||||
<code class="filename">config.h</code> which is used to make platform
|
|
||||||
specific definitions. In this situation, we assume that you
|
|
||||||
have access to <code class="classname">sstream</code>. Our understanding is that
|
|
||||||
this should not be a problem for VC++ 7.x. However, if this
|
|
||||||
is not the case and you need to use <code class="classname">strstream</code>,
|
|
||||||
then simply tell your compiler to define the variable
|
|
||||||
<code class="constant">HAVE_STRSTREAM</code> and undefine
|
|
||||||
<code class="constant">HAVE_SSTREAM</code> That
|
|
||||||
<span class="emphasis"><em>should</em></span> work. We think. Alternatively, just edit
|
|
||||||
the files <code class="filename">ValueArg.h</code> and <code class="filename">MultiArg.h</code>.
|
|
||||||
</p></div><p>
|
|
||||||
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="RANDOM_NOTE"></a>Random Note</h3></div></div></div><p>
|
|
||||||
If your compiler doesn't support the <code class="methodname">using</code> syntax used
|
|
||||||
in <code class="classname">UnlabeledValueArg</code> and
|
|
||||||
<code class="classname">UnlabeledMultiArg</code> to support two stage name lookup,
|
|
||||||
then you have two options. Either comment out the statements if you don't
|
|
||||||
need two stage name lookup, or do a bunch of search and replace and use
|
|
||||||
the <code class="methodname">this</code> pointer syntax: e.g.
|
|
||||||
<code class="methodname">this->_ignoreable</code> instead
|
|
||||||
of just <code class="methodname">_ignorable</code> (do this for each variable
|
|
||||||
or method referenced by <code class="methodname">using</code>).
|
|
||||||
</p></div><p>
|
|
||||||
</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="FUNDAMENTAL_CLASSES"></a>Chapter 2. Fundamental Classes</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="#COMMAND_LINE"><code class="classname">CmdLine</code></a></span></dt><dt><span class="sect1"><a href="#SWITCH_ARG"><code class="classname">SwitchArg</code></a></span></dt><dt><span class="sect1"><a href="#VALUE_ARG"><code class="classname">ValueArg</code></a></span></dt><dt><span class="sect1"><a href="#MULTI_ARG"><code class="classname">MultiArg</code></a></span></dt><dt><span class="sect1"><a href="#MULTI_SWITCH_ARG"><code class="classname">MultiSwitchArg</code></a></span></dt><dt><span class="sect1"><a href="#UNLABELED_VALUE_ARG"><code class="classname">UnlabeledValueArg</code></a></span></dt><dt><span class="sect1"><a href="#UNLABELED_MULTI_ARG"><code class="classname">UnlabeledMultiArg</code></a></span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="COMMAND_LINE"></a><code class="classname">CmdLine</code></h2></div></div></div><p>
|
|
||||||
The <code class="classname">CmdLine</code> class contains the arguments that define
|
|
||||||
the command line and manages the parsing of the command line. The
|
|
||||||
<code class="classname">CmdLine</code> doesn't parse the command line itself it only
|
|
||||||
manages the parsing. The actual parsing of individual arguments occurs within
|
|
||||||
the arguments themselves. The <code class="classname">CmdLine</code> keeps track of
|
|
||||||
of the required arguments, <a class="link" href="#XOR" title="I want one argument or the other, but not both...">relationships</a>
|
|
||||||
between arguments, and <a class="link" href="#CHANGE_OUTPUT" title="I want different output than what is provided...">output</a> generation.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="SWITCH_ARG"></a><code class="classname">SwitchArg</code></h2></div></div></div><p><code class="classname">SwitchArg</code>s are what the name implies:
|
|
||||||
simple, on/off, boolean switches. Use <code class="classname">SwitchArg</code>s
|
|
||||||
anytime you want to turn
|
|
||||||
some sort of system property on or off. <code class="classname">SwitchArg</code>s
|
|
||||||
don't parse a value. They return <code class="constant">TRUE</code> or
|
|
||||||
<code class="constant">FALSE</code>, depending on whether the switch has been found
|
|
||||||
on the command line and what the default value was defined as.</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="VALUE_ARG"></a><code class="classname">ValueArg</code></h2></div></div></div><p><code class="classname">ValueArg</code>s are arguments that read a
|
|
||||||
value of some type
|
|
||||||
from the command line. Any time you need a file name, a number,
|
|
||||||
etc. use a <code class="classname">ValueArg</code> or one of its variants.
|
|
||||||
All <code class="classname">ValueArg</code>s are
|
|
||||||
<a class="link" href="#USING_ARGTRAITS" title="I want to use different types..."> templatized</a> and will attempt to parse
|
|
||||||
the string its flag matches on the command line as the type it is
|
|
||||||
specified as. <code class="classname">ValueArg<int></code>
|
|
||||||
will attempt to parse an
|
|
||||||
int, <code class="classname">ValueArg<float></code> will attempt to
|
|
||||||
parse a float, etc. If <code class="methodname">operator>></code>
|
|
||||||
for the specified type doesn't
|
|
||||||
recognize the string on the command line as its defined type, then
|
|
||||||
an exception will be thrown.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="MULTI_ARG"></a><code class="classname">MultiArg</code></h2></div></div></div><p>
|
|
||||||
A <code class="classname">MultiArg</code> is a <code class="classname">ValueArg</code> that
|
|
||||||
can be specified more than once on a command line and instead of returning
|
|
||||||
a single value, returns a <code class="classname">vector</code> of values.
|
|
||||||
</p><p>
|
|
||||||
Imagine a compiler that allows you to specify multiple directories
|
|
||||||
to search for libraries...
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
% fooCompiler -L /dir/num1 -L /dir/num2 file.foo
|
|
||||||
</pre><p>
|
|
||||||
Exceptions will occur if you try to do this
|
|
||||||
with a <code class="classname">ValueArg</code> or a <code class="classname">SwitchArg</code>.
|
|
||||||
In situations like this, you will want to use a
|
|
||||||
<code class="classname">MultiArg</code>. A
|
|
||||||
<code class="classname">MultiArg</code> is essentially a
|
|
||||||
<code class="classname">ValueArg</code> that appends any
|
|
||||||
value that it matches and parses onto a vector of values. When the
|
|
||||||
<code class="methodname">getValue()</code> method is called, a vector of
|
|
||||||
values, instead of a single value is returned. A
|
|
||||||
<code class="classname">MultiArg</code> is declared much like
|
|
||||||
a <code class="classname">ValueArg</code>:
|
|
||||||
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
MultiArg<int> itest("i", "intTest", "multi int test", false,"int" );
|
|
||||||
cmd.add( itest );
|
|
||||||
</pre><p>
|
|
||||||
Note that <code class="classname">MultiArg</code>s can be added to the
|
|
||||||
<code class="classname">CmdLine</code> in any order (unlike
|
|
||||||
<a class="link" href="#UNLABELED_MULTI_ARG" title="UnlabeledMultiArg"> UnlabeledMultiArg</a>).
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="MULTI_SWITCH_ARG"></a><code class="classname">MultiSwitchArg</code></h2></div></div></div><p>
|
|
||||||
A <code class="classname">MultiSwitchArg</code> is a <code class="classname">SwitchArg</code>
|
|
||||||
that can be specified more than once on a command line.
|
|
||||||
This can be useful
|
|
||||||
when command lines are constructed automatically from within other applications
|
|
||||||
or when a switch occurring
|
|
||||||
more than once indicates a value (-V means a little verbose -V -V -V means a lot
|
|
||||||
verbose), You can use a <code class="classname">MultiSwitchArg</code>.
|
|
||||||
The call
|
|
||||||
to <code class="methodname">getValue()</code> for a <code class="classname">MultiSwitchArg</code> returns the number (int) of times
|
|
||||||
the switch has been found on the command line in addition to the default value.
|
|
||||||
Here is an example using the default initial value of 0:
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
MultiSwitchArg quiet("q","quiet","Reduce the volume of output");
|
|
||||||
cmd.add( quiet );
|
|
||||||
</pre><p>
|
|
||||||
Alternatively, you can specify your own initial value:
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
MultiSwitchArg quiet("q","quiet","Reduce the volume of output",5);
|
|
||||||
cmd.add( quiet );
|
|
||||||
</pre><p>
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="UNLABELED_VALUE_ARG"></a><code class="classname">UnlabeledValueArg</code></h2></div></div></div><p>
|
|
||||||
An <code class="classname">UnlabeledValueArg</code> is a <code class="classname">ValueArg</code> that is not identified by a flag on the command line. Instead
|
|
||||||
<code class="classname">UnlabeledValueArg</code>s are identified by their position in
|
|
||||||
the argv array.
|
|
||||||
</p><p>
|
|
||||||
To this point all of our arguments have had labels (flags)
|
|
||||||
identifying them on the command line, but there are some
|
|
||||||
situations where flags are burdensome and not worth the effort. One
|
|
||||||
example might be if you want to implement a magical command we'll
|
|
||||||
call <span class="command"><strong>copy</strong></span>. All <span class="command"><strong>copy</strong></span> does is
|
|
||||||
copy the file specified
|
|
||||||
in the first argument to the file specified in the second argument.
|
|
||||||
We can do this using <code class="classname">UnlabeledValueArg</code>s which are pretty
|
|
||||||
much just <code class="classname">ValueArg</code>s without the flag specified,
|
|
||||||
which tells
|
|
||||||
the <code class="classname">CmdLine</code> object to treat them accordingly.
|
|
||||||
The code would look like this:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
UnlabeledValueArg<float> nolabel( "name", "unlabeled test", true, 3.14,
|
|
||||||
"nameString" );
|
|
||||||
cmd.add( nolabel );
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
Everything else is handled identically to what is seen above. The
|
|
||||||
only difference to be aware of, and this is important: <span class="emphasis"><em>the order
|
|
||||||
that UnlabeledValueArgs are added to the <code class="classname">CmdLine</code>
|
|
||||||
is the order that they will be parsed!!!!</em></span>
|
|
||||||
This is <span class="emphasis"><em>not</em></span> the case for normal
|
|
||||||
<code class="classname">SwitchArg</code>s and <code class="classname">ValueArg</code>s.
|
|
||||||
What happens internally is the first argument that the
|
|
||||||
<code class="classname">CmdLine</code> doesn't recognize is assumed to be
|
|
||||||
the first <code class="classname">UnlabeledValueArg</code> and
|
|
||||||
parses it as such. Note that you are allowed to intersperse labeled
|
|
||||||
args (SwitchArgs and ValueArgs) in between
|
|
||||||
<code class="classname">UnlabeledValueArgs</code> (either on the command line
|
|
||||||
or in the declaration), but the <code class="classname">UnlabeledValueArgs</code>
|
|
||||||
will still be parsed in the order they are added. Just remember that order is
|
|
||||||
important for unlabeled arguments.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="UNLABELED_MULTI_ARG"></a><code class="classname">UnlabeledMultiArg</code></h2></div></div></div><p>
|
|
||||||
An <code class="classname">UnlabeledMultiArg</code> is an <code class="classname">UnlabeledValueArg</code> that allows more than one value to be specified. Only one
|
|
||||||
<code class="classname">UnlabeledMultiArg</code> can be specified per command line.
|
|
||||||
The <code class="classname">UnlabeledMultiArg</code> simply reads the remaining
|
|
||||||
values from argv up until -- or the end of the array is reached.
|
|
||||||
</p><p>
|
|
||||||
Say you want a strange command
|
|
||||||
that searches each file specified for a given string (let's call it
|
|
||||||
<span class="command"><strong>grep</strong></span>), but you don't want to have to type in all of the file
|
|
||||||
names or write a script to do it for you. Say,
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
% grep pattern *.txt
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
First remember that the <span class="emphasis"><em>*</em></span> is handled by the shell and
|
|
||||||
expanded accordingly, so what the program <span class="command"><strong>grep</strong></span> sees is
|
|
||||||
really something like:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
% grep pattern file1.txt file2.txt fileZ.txt
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
To handle situations where multiple, unlabeled arguments are needed,
|
|
||||||
we provide the <code class="classname">UnlabeledMultiArg</code>.
|
|
||||||
<code class="classname">UnlabeledMultiArg</code>s
|
|
||||||
are declared much like everything else, but with only a description
|
|
||||||
of the arguments. By default, if an <code class="classname">UnlabeledMultiArg</code>
|
|
||||||
is specified, then at least one is required to be present or an
|
|
||||||
exception will be thrown. The most important thing to remember is,
|
|
||||||
that like <code class="classname">UnlabeledValueArg</code>s: order matters!
|
|
||||||
In fact, <span class="emphasis"><em>an UnlabeledMultiArg must be the last argument added to the
|
|
||||||
CmdLine!</em></span>. Here is what a declaration looks like:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
//
|
|
||||||
// UnlabeledMultiArg must be the LAST argument added!
|
|
||||||
//
|
|
||||||
UnlabeledMultiArg<string> multi("file names");
|
|
||||||
cmd.add( multi );
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
|
|
||||||
vector<string> fileNames = multi.getValue();
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
You must only ever specify one (1) <code class="classname">UnlabeledMultiArg</code>.
|
|
||||||
One <code class="classname">UnlabeledMultiArg</code> will read every unlabeled
|
|
||||||
Arg that wasn't already processed by a
|
|
||||||
<code class="classname">UnlabeledValueArg</code> into a
|
|
||||||
<code class="classname">vector</code> of type T. Any
|
|
||||||
<code class="classname">UnlabeledValueArg</code> or other
|
|
||||||
<code class="classname">UnlabeledMultiArg</code> specified after the first
|
|
||||||
<code class="classname">UnlabeledMultiArg</code> will be ignored, and if
|
|
||||||
they are required,
|
|
||||||
exceptions will be thrown. When you call the
|
|
||||||
<code class="methodname">getValue()</code>
|
|
||||||
method of the <code class="classname">UnlabeledValueArg</code> argument,
|
|
||||||
a <code class="classname">vector</code>
|
|
||||||
will be returned. If you can imagine a situation where there will
|
|
||||||
be multiple args of multiple types (stings, ints, floats, etc.)
|
|
||||||
then just declare the <code class="classname">UnlabeledMultiArg</code> as type
|
|
||||||
<code class="classname">string</code> and parse the different values yourself or use
|
|
||||||
several <code class="classname">UnlabeledValueArg</code>s.
|
|
||||||
</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="COMPLICATIONS"></a>Chapter 3. Complications</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="#COMBINE_SWITCHES">I want to combine multiple switches into one argument...</a></span></dt><dt><span class="sect1"><a href="#XOR">I want one argument or the other, but not both...</a></span></dt><dt><span class="sect1"><a href="#NO_FLAG">I have more arguments than single flags make sense for...</a></span></dt><dt><span class="sect1"><a href="#CONSTRAINT">I want to constrain the values allowed for a particular
|
|
||||||
argument...</a></span></dt><dt><span class="sect1"><a href="#ARG_ADD_CMDLINE">I want the Args to add themselves to the CmdLine...</a></span></dt><dt><span class="sect1"><a href="#CHANGE_OUTPUT">I want different output than what is provided...</a></span></dt><dt><span class="sect1"><a href="#NO_HELP_VERSION">I don't want the --help and --version switches to be created automatically...</a></span></dt><dt><span class="sect1"><a href="#IGNORE_ARGS">I want to ignore certain arguments...</a></span></dt><dt><span class="sect1"><a href="#IGNORE_UNMATCHED">I want to ignore unmatched arguments...</a></span></dt><dt><span class="sect1"><a href="#READING_HEX_INTEGERS">I want to read hex integers as arguments...</a></span></dt><dt><span class="sect1"><a href="#USING_ARGTRAITS">I want to use different types...</a></span></dt><dt><span class="sect1"><a href="#CHANGING_STARTSTRINGS">I want to use Windows-style flags like "/x" and "/y"...</a></span></dt></dl></div><p>
|
|
||||||
Naturally, what we have seen to this point doesn't satisfy all of
|
|
||||||
our needs.
|
|
||||||
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="COMBINE_SWITCHES"></a>I want to combine multiple switches into one argument...</h2></div></div></div><p>
|
|
||||||
Multiple <code class="classname">SwitchArg</code>s can be combined into a
|
|
||||||
single argument on the command line. If you have switches -a, -b and -c
|
|
||||||
it is valid to do either:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
% command -a -b -c
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
<span class="emphasis"><em>or</em></span>
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
% command -abc
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
<span class="emphasis"><em>or</em></span>
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
% command -ba -c
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
This is to make this library more in line with the POSIX and GNU
|
|
||||||
standards (as I understand them).
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="XOR"></a>I want one argument or the other, but not both...</h2></div></div></div><p>
|
|
||||||
Suppose you have a command that must read input from one of two
|
|
||||||
possible locations, either a local file or a URL. The command
|
|
||||||
<span class="emphasis"><em>must</em></span> read something, so <span class="emphasis"><em>one</em></span>
|
|
||||||
argument is required, but
|
|
||||||
not both, yet neither argument is strictly necessary by itself.
|
|
||||||
This is called "exclusive or" or "XOR". To accommodate this
|
|
||||||
situation, there is now an option to add two or more
|
|
||||||
<code class="classname">Arg</code>s to
|
|
||||||
a <code class="classname">CmdLine</code> that are exclusively or'd with one another:
|
|
||||||
<code class="methodname">xorAdd()</code>. This means that exactly one of the
|
|
||||||
<code class="classname">Arg</code>s must be set and no more.
|
|
||||||
</p><p>
|
|
||||||
<code class="methodname">xorAdd()</code> comes in two flavors, either
|
|
||||||
<code class="methodname">xorAdd(Arg& a, Arg& b)</code>
|
|
||||||
to add just two <code class="classname">Arg</code>s to be xor'd and
|
|
||||||
<code class="methodname">xorAdd( vector<Arg*> xorList )</code>
|
|
||||||
to add more than two <code class="classname">Arg</code>s.
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
|
|
||||||
ValueArg<string> fileArg("f","file","File name to read",true,"/dev/null", "filename");
|
|
||||||
ValueArg<string> urlArg("u","url","URL to load",true, "http://example.com", "URL");
|
|
||||||
|
|
||||||
cmd.xorAdd( fileArg, urlArg );
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
Once one <code class="classname">Arg</code> in the xor list is matched on the
|
|
||||||
<code class="classname">CmdLine</code> then the others in the xor list will be
|
|
||||||
marked as set. The question then, is how to determine which of the
|
|
||||||
<code class="classname">Arg</code>s has been set? This is accomplished by calling the
|
|
||||||
isSet() method for each <code class="classname">Arg</code>. If the
|
|
||||||
<code class="classname">Arg</code> has been
|
|
||||||
matched on the command line, the <code class="methodname">isSet()</code> will return
|
|
||||||
<code class="constant">TRUE</code>, whereas if the <code class="classname">Arg</code>
|
|
||||||
has been set as a result of matching the other <code class="classname">Arg</code>
|
|
||||||
that was xor'd <code class="methodname">isSet()</code> will
|
|
||||||
return <code class="constant">FALSE</code>.
|
|
||||||
(Of course, if the <code class="classname">Arg</code> was not xor'd and
|
|
||||||
wasn't matched, it will also return <code class="constant">FALSE</code>.)
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
if ( fileArg.isSet() )
|
|
||||||
readFile( fileArg.getValue() );
|
|
||||||
else if ( urlArg.isSet() )
|
|
||||||
readURL( urlArg.getValue() );
|
|
||||||
else
|
|
||||||
// Should never get here because TCLAP will note that one of the
|
|
||||||
// required args above has not been set.
|
|
||||||
throw("Very bad things...");
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
It is helpful to note that <code class="classname">Arg</code>s of any type can be xor'd together.
|
|
||||||
This means that you can xor a <code class="classname">SwitchArg</code> with a <code class="classname">ValueArg</code>.
|
|
||||||
This is helpful in situations where one of several options is necessary and one of the options
|
|
||||||
requires additional information.
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
SwitchArg stdinArg("s", "stdin", "Read from STDIN", false);
|
|
||||||
ValueArg<string> fileArg("f","file","File name to read",true,"/dev/null", "filename");
|
|
||||||
ValueArg<string> urlArg("u","url","URL to load",true, "http://example.com", "URL");
|
|
||||||
|
|
||||||
vector<Arg*> xorlist;
|
|
||||||
xorlist.push_back(&stdinArg);
|
|
||||||
xorlist.push_back(&fileArg);
|
|
||||||
xorlist.push_back(&urlArg);
|
|
||||||
|
|
||||||
cmd.xorAdd( xorlist );
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="NO_FLAG"></a>I have more arguments than single flags make sense for...</h2></div></div></div><p>
|
|
||||||
Some commands have so many options that single flags no longer map
|
|
||||||
sensibly to the available options. In this case, it is desirable to
|
|
||||||
specify <code class="classname">Arg</code>s using only long options. This one is easy to
|
|
||||||
accomplish, just make the flag value blank in the <code class="classname">Arg</code>
|
|
||||||
constructor. This will tell the <code class="classname">Arg</code> that only the long
|
|
||||||
option should be matched and will force users to specify the long
|
|
||||||
option on the command line. The help output is updated accordingly.
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
ValueArg<string> fileArg("","file","File name",true,"homer","filename");
|
|
||||||
|
|
||||||
SwitchArg caseSwitch("","upperCase","Print in upper case",false);
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="CONSTRAINT"></a>I want to constrain the values allowed for a particular
|
|
||||||
argument...</h2></div></div></div><p>
|
|
||||||
<span class="emphasis"><em>Interface Change!!!</em></span> Sorry folks, but we've changed
|
|
||||||
the interface since version 1.0.X for constraining <code class="classname">Arg</code>s.
|
|
||||||
Constraints are now hidden behind the <code class="classname">Constraint</code>
|
|
||||||
interface. To
|
|
||||||
constrain an <code class="classname">Arg</code> simply implement the interface
|
|
||||||
and specify the new class in the constructor as before.
|
|
||||||
</p><p>
|
|
||||||
You can still constrain <code class="classname">Arg</code>s based on
|
|
||||||
a list of values. Instead of adding a <code class="classname">vector</code> of
|
|
||||||
allowed values to the <code class="classname">Arg</code> directly,
|
|
||||||
create a <code class="classname">ValuesConstraint</code> object
|
|
||||||
with a <code class="classname">vector</code> of values and add that to the
|
|
||||||
<code class="classname">Arg</code>. The <code class="classname">Arg</code> constructors
|
|
||||||
have been modified accordingly.
|
|
||||||
</p><p>
|
|
||||||
When the value for the
|
|
||||||
<code class="classname">Arg</code> is parsed,
|
|
||||||
it is checked against the list of values specified in the
|
|
||||||
<code class="classname">ValuesConstraint</code>.
|
|
||||||
If the value is in the list then it is accepted. If
|
|
||||||
not, then an exception is thrown. Here is a simple example:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
vector<string> allowed;
|
|
||||||
allowed.push_back("homer");
|
|
||||||
allowed.push_back("marge");
|
|
||||||
allowed.push_back("bart");
|
|
||||||
allowed.push_back("lisa");
|
|
||||||
allowed.push_back("maggie");
|
|
||||||
ValuesConstraint<string> allowedVals( allowed );
|
|
||||||
|
|
||||||
ValueArg<string> nameArg("n","name","Name to print",true,"homer",&allowedVals);
|
|
||||||
cmd.add( nameArg );
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
When a <code class="classname">ValuesConstraint</code> is specified,
|
|
||||||
instead of a type description being specified in the
|
|
||||||
<code class="classname">Arg</code>, a
|
|
||||||
type description is created by concatenating the values in the
|
|
||||||
allowed list using operator<< for the specified type. The
|
|
||||||
help/usage for the <code class="classname">Arg</code> therefore lists the
|
|
||||||
allowable values. Because of this, you might want to keep the list
|
|
||||||
relatively small, however there is no limit on this.
|
|
||||||
</p><p>
|
|
||||||
Obviously, a list of allowed values isn't always the best way to
|
|
||||||
constrain things. For instance, one might wish to allow only
|
|
||||||
integers greater than 0. In this case, simply create a class that
|
|
||||||
implements the <code class="classname">Constraint<int></code> interface and
|
|
||||||
checks whether the value parsed is greater than 0 (done in the
|
|
||||||
<code class="methodname">check()</code> method) and create your
|
|
||||||
<code class="classname">Arg</code> with your new <code class="classname">Constraint</code>.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ARG_ADD_CMDLINE"></a>I want the Args to add themselves to the CmdLine...</h2></div></div></div><p>
|
|
||||||
New constructors have been added for each <code class="classname">Arg</code>
|
|
||||||
that take a <code class="classname">CmdLine</code> object as an argument.
|
|
||||||
Each <code class="classname">Arg</code> then
|
|
||||||
<code class="methodname">add</code>s itself to the <code class="classname">CmdLine</code>
|
|
||||||
object. There is no difference in how the <code class="classname">Arg</code>
|
|
||||||
is handled between this method and calling the
|
|
||||||
<code class="methodname">add()</code> method directly. At the moment, there is
|
|
||||||
no way to do an <code class="methodname">xorAdd()</code> from the constructor. Here
|
|
||||||
is an example:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
// Create the command line.
|
|
||||||
CmdLine cmd("this is a message", '=', "0.99" );
|
|
||||||
|
|
||||||
// Note that the following args take the "cmd" object as arguments.
|
|
||||||
SwitchArg btest("B","existTestB", "exist Test B", cmd, false );
|
|
||||||
|
|
||||||
ValueArg<string> stest("s", "stringTest", "string test", true, "homer",
|
|
||||||
"string", cmd );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> utest("unTest1","unlabeled test one",
|
|
||||||
"default","string", cmd );
|
|
||||||
|
|
||||||
// NO add() calls!
|
|
||||||
|
|
||||||
// Parse the command line.
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="CHANGE_OUTPUT"></a>I want different output than what is provided...</h2></div></div></div><p>
|
|
||||||
It is straightforward to change the output generated by
|
|
||||||
<span class="emphasis"><em>TCLAP</em></span>. Either subclass the
|
|
||||||
<code class="classname">StdOutput</code> class and re-implement the methods you choose,
|
|
||||||
or write your own class that implements the
|
|
||||||
<code class="classname">CmdLineOutput</code> interface. Once you have done this,
|
|
||||||
then use the <code class="classname">CmdLine</code> <code class="methodname">setOutput</code>
|
|
||||||
method to tell the <code class="classname">CmdLine</code> to use your new output
|
|
||||||
class. Here is a simple example:
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
class MyOutput : public StdOutput
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void failure(CmdLineInterface& c, ArgException& e)
|
|
||||||
{
|
|
||||||
cerr << "My special failure message for: " << endl
|
|
||||||
<< e.what() << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void usage(CmdLineInterface& c)
|
|
||||||
{
|
|
||||||
cout << "my usage message:" << endl;
|
|
||||||
list<Arg*> args = c.getArgList();
|
|
||||||
for (ArgListIterator it = args.begin(); it != args.end(); it++)
|
|
||||||
cout << (*it)->longID()
|
|
||||||
<< " (" << (*it)->getDescription() << ")" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void version(CmdLineInterface& c)
|
|
||||||
{
|
|
||||||
cout << "my version message: 0.1" << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
|
|
||||||
// set the output
|
|
||||||
MyOutput my;
|
|
||||||
cmd.setOutput( &my );
|
|
||||||
|
|
||||||
// proceed normally ...
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
See <code class="filename">test4.cpp</code> in the examples directory for the full
|
|
||||||
example. <span class="emphasis"><em>NOTE</em></span>: if you supply your own Output object, we
|
|
||||||
will not delete it in the <code class="classname">CmdLine</code> destructor. This
|
|
||||||
could lead to a (very small) memory leak if you don't take care of the object
|
|
||||||
yourself. Also note that the <code class="methodname">failure</code> method is
|
|
||||||
now responsible for exiting the application (assuming that is the desired
|
|
||||||
behavior).
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="NO_HELP_VERSION"></a>I don't want the --help and --version switches to be created automatically...</h2></div></div></div><p>
|
|
||||||
Help and version information is useful for nearly all command line applications
|
|
||||||
and as such we generate flags that provide those options automatically.
|
|
||||||
However, there are situations when these flags are undesirable. For these
|
|
||||||
cases we've added we've added a forth parameter to the
|
|
||||||
<code class="classname">CmdLine</code> constructor. Making this boolean parameter
|
|
||||||
false will disable automatic help and version generation.
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99", false );
|
|
||||||
</pre><p>
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="IGNORE_ARGS"></a>I want to ignore certain arguments...</h2></div></div></div><p>
|
|
||||||
The <em class="parameter"><code>--</code></em> flag is automatically included in the
|
|
||||||
<code class="classname">CmdLine</code>.
|
|
||||||
As (almost) per POSIX and GNU standards, any argument specified
|
|
||||||
after the <em class="parameter"><code>--</code></em> flag is ignored.
|
|
||||||
<span class="emphasis"><em>Almost</em></span> because if an
|
|
||||||
<code class="classname">UnlabeledValueArg</code> that has not been set or an
|
|
||||||
<code class="classname">UnlabeledMultiArg</code> has been specified, by default
|
|
||||||
we will assign any arguments beyond the <em class="parameter"><code>--</code></em>
|
|
||||||
to the those arguments as
|
|
||||||
per the rules above. This is primarily useful if you want to pass
|
|
||||||
in arguments with a dash as the first character of the argument. It
|
|
||||||
should be noted that even if the <em class="parameter"><code>--</code></em> flag is
|
|
||||||
passed on the command line, the <code class="classname">CmdLine</code> will
|
|
||||||
<span class="emphasis"><em>still</em></span> test to make sure all of the required
|
|
||||||
arguments are present.
|
|
||||||
</p><p>
|
|
||||||
Of course, this isn't how POSIX/GNU handle things, they explicitly
|
|
||||||
ignore arguments after the <em class="parameter"><code>--</code></em>. To accommodate this,
|
|
||||||
we can make both <code class="classname">UnlabeledValueArg</code>s and
|
|
||||||
<code class="classname">UnlabeledMultiArg</code>s ignoreable in their constructors.
|
|
||||||
See the <a class="ulink" href="html/index.html" target="_top"> API Documentation</a> for details.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="IGNORE_UNMATCHED"></a>I want to ignore unmatched arguments...</h2></div></div></div><p>
|
|
||||||
By default, if <span class="emphasis"><em>TCLAP</em></span> sees an argument that doesn't
|
|
||||||
match a specified <code class="classname">Arg</code>, it will produce an exception.
|
|
||||||
This strict handling provides some assurance that all input to a program
|
|
||||||
is controlled. However, there are times when
|
|
||||||
this strict handling of arguments might not be desirable.
|
|
||||||
<span class="emphasis"><em>TCLAP</em></span> provides two alternatives. The first is to
|
|
||||||
add an <code class="classname">UnlabeledMultiArg</code> to the command line. If
|
|
||||||
this is done, all unmatched arguments will get added to this arg.
|
|
||||||
|
|
||||||
The second option is that
|
|
||||||
that <span class="emphasis"><em>TCLAP</em></span> can simply ignore any unmatched
|
|
||||||
arguments on the command line. This is accomplished by calling the
|
|
||||||
<code class="methodname">ignoreUnmatched</code> method with
|
|
||||||
<em class="parameter"><code>true</code></em> on the
|
|
||||||
<code class="classname">CmdLine</code> object that's been constructed.
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
|
|
||||||
// Tell the command line to ignore any unmatched args.
|
|
||||||
cmd.ignoreUnmatched(true);
|
|
||||||
|
|
||||||
// Define a value argument and add it to the command line.
|
|
||||||
ValueArg<string> nameArg("n","name","Name to print",true,"homer","string");
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
Given the program above, if a user were to type:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
% command -n Mike something to ignore
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
The program would succeed and the name <code class="classname">ValueArg</code>
|
|
||||||
would be populated with "Mike" but
|
|
||||||
the strings "something", "to", and "ignore" would simply be ignored by the
|
|
||||||
parser.
|
|
||||||
</p><p>
|
|
||||||
<span class="emphasis"><em>NOTE:</em></span> If both <code class="methodname">ignoreUnmatched</code>
|
|
||||||
is set to true and an <code class="classname">UnlabeledMultiArg</code> is added to
|
|
||||||
the command line, then the <code class="classname">UnlabeledMultiArg</code> will
|
|
||||||
"win" and all extra arguments will be added to it rather than be ignored.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="READING_HEX_INTEGERS"></a>I want to read hex integers as arguments...</h2></div></div></div><p>
|
|
||||||
Sometimes it's desirable to read integers formatted in decimal, hexadecimal,
|
|
||||||
and octal format. This is now possible by #defining the <em class="parameter"><code>TCLAP_SETBASE_ZERO</code></em>
|
|
||||||
directive. Simply define this directive in your code and integer arguments will be parsed
|
|
||||||
in each base.
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
#define TCLAP_SETBASE_ZERO 1
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
|
|
||||||
ValueArg<int> itest("i", "intTest", "integer test", true, 5, "int");
|
|
||||||
cmd.add( itest );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
int _intTest = itest.getValue();
|
|
||||||
cout << "found int: " << _intTest << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
</pre><p>
|
|
||||||
</p><p>
|
|
||||||
The reason that this behavior is not the default behavior for <span class="emphasis"><em>TCLAP</em></span> is that the use of
|
|
||||||
<code class="methodname">setbase(0)</code> appears to be something of a side effect and is not necessarily how
|
|
||||||
<code class="methodname">setbase()</code> is meant to be used. So while we're making this functionality
|
|
||||||
available, we're not turning it on by default for fear of bad things happening in different compilers.
|
|
||||||
If you know otherwise, please let us know.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="USING_ARGTRAITS"></a>I want to use different types...</h2></div></div></div><p>
|
|
||||||
The usual C++ types (int, long, bool, etc.) are supported by <span class="emphasis"><em>TCLAP</em></span> out
|
|
||||||
of the box. As
|
|
||||||
long as operator>> and operator<< are supported, other types should work fine
|
|
||||||
too, you'll just need to specify the <code class="classname">ArgTraits</code> which
|
|
||||||
tells <span class="emphasis"><em>TCLAP</em></span> how you expect the type to be handled.
|
|
||||||
</p><p>
|
|
||||||
|
|
||||||
For example, assume that you'd like to read one argument on the
|
|
||||||
command line in as a <code class="classname">std::pair</code> object. You need
|
|
||||||
to tell <span class="emphasis"><em>TCLAP</em></span> whether to treat
|
|
||||||
<code class="classname">std::pair</code> as a String or Value (default).
|
|
||||||
StringLike means to treat the string on the command line as a string
|
|
||||||
and use it directly (by assignment operator), whereas ValueLike means
|
|
||||||
that a value object should be extracted from the string using
|
|
||||||
operator>>. For <code class="classname">std::pair</code> we'll choose
|
|
||||||
ValueLike. Here is an example of how to do this for int,double pair
|
|
||||||
(see <code class="filename">test30.cpp</code>):
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
|
|
||||||
// We need to tell TCLAP how to parse our pair, we assume it will be
|
|
||||||
// given as two arguments separated by whitespace.
|
|
||||||
std::istream &operator>>(std::istream &is, std::pair<int, double> &p) {
|
|
||||||
return is >> p.first >> p.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make it easy to print values of our type.
|
|
||||||
std::ostream &operator<<(std::ostream &os, const std::pair<int, double> &p) {
|
|
||||||
return os << p.first << ' ' << p.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Our pair can now be used as any other type.
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
CmdLine cmd("test pair argument");
|
|
||||||
ValueArg<std::pair<int, double> > parg("p", "pair", "int,double pair",
|
|
||||||
true,
|
|
||||||
std::make_pair(0, 0.0),
|
|
||||||
"int,double",
|
|
||||||
cmd);
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
std::cout << parg.getValue() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
<span class="emphasis"><em>Important:</em></span> When specifying the argument on the command line it
|
|
||||||
needs to be given as a single argument, that is by quoting it. For
|
|
||||||
example, <code class="code">./test30 -p "1 2.3"</code>.
|
|
||||||
</p><p>
|
|
||||||
If you do not want to provide operator>>, you can instead use
|
|
||||||
operator= by defining the type as
|
|
||||||
<code class="classname">StringLike</code>. A complete example is given in
|
|
||||||
<code class="filename">test11.cpp</code>, but the main difference is you need
|
|
||||||
to tell TCLAP to assign to the type using operator=. This is done by
|
|
||||||
defining it as <code class="classname">StringLike</code> as shown below:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
namespace TCLAP {
|
|
||||||
template<>
|
|
||||||
struct ArgTraits<Vect3D> {
|
|
||||||
typedef StringLike ValueCategory;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
</pre><p>
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="CHANGING_STARTSTRINGS"></a>I want to use Windows-style flags like "/x" and "/y"...</h2></div></div></div><p>
|
|
||||||
It is traditional in Posix environments that the "-" and "--" strings are used to signify
|
|
||||||
the beginning of argument flags and long argument names. However, other environments,
|
|
||||||
namely Windows, use different strings. <span class="emphasis"><em>TCLAP</em></span> allows you to
|
|
||||||
control which strings are used with <code class="methodname">#define</code> directives. This allows
|
|
||||||
you to use different strings based on your operating environment. Here is an example:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
//
|
|
||||||
// This illustrates how to change the flag and name start strings for
|
|
||||||
// Windows, otherwise the defaults are used.
|
|
||||||
//
|
|
||||||
// Note that these defines need to happen *before* tclap is included!
|
|
||||||
//
|
|
||||||
#ifdef WINDOWS
|
|
||||||
#define TCLAP_NAMESTARTSTRING "~~"
|
|
||||||
#define TCLAP_FLAGSTARTSTRING "/"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// Everything else is identical!
|
|
||||||
...
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
|
|
||||||
</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="NOTES"></a>Chapter 4. Notes</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="#DESCRIPTION_EXCEPTIONS">Type Descriptions</a></span></dt><dt><span class="sect1"><a href="#VISITORS">Visitors</a></span></dt><dt><span class="sect1"><a href="#MORE_INFO">More Information</a></span></dt></dl></div><p>
|
|
||||||
Like all good rules, there are many exceptions....
|
|
||||||
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="DESCRIPTION_EXCEPTIONS"></a>Type Descriptions</h2></div></div></div><p>
|
|
||||||
Ideally this library would use RTTI to return a human readable name
|
|
||||||
of the type declared for a particular argument. Unfortunately, at
|
|
||||||
least for <span class="command"><strong>g++</strong></span>, the names returned aren't
|
|
||||||
particularly useful.
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="VISITORS"></a>Visitors</h2></div></div></div><p>
|
|
||||||
Disclaimer: Almost no one will have any use for
|
|
||||||
<code class="classname">Visitor</code>s, they were
|
|
||||||
added to provide special handling for default arguments. Nothing
|
|
||||||
that <code class="classname">Visitor</code>s do couldn't be accomplished
|
|
||||||
by the user after the
|
|
||||||
command line has been parsed. If you're still interested, keep
|
|
||||||
reading...
|
|
||||||
</p><p>
|
|
||||||
Some of you may be wondering how we get the <em class="parameter"><code>--help</code></em>,
|
|
||||||
<em class="parameter"><code>--version</code></em> and <em class="parameter"><code>--</code></em>
|
|
||||||
arguments to do their thing without mucking up the
|
|
||||||
<code class="classname">CmdLine</code> code with lots of <span class="emphasis"><em>if</em></span>
|
|
||||||
statements and type checking. This is accomplished by using a
|
|
||||||
variation on the Visitor Pattern. Actually, it may not be a Visitor
|
|
||||||
Pattern at all, but that's what inspired me.
|
|
||||||
</p><p>
|
|
||||||
If we want some argument to do some sort of special handling,
|
|
||||||
besides simply parsing a value, then we add a <code class="classname">Visitor</code>
|
|
||||||
pointer to the <code class="classname">Arg</code>. More specifically, we add a
|
|
||||||
<span class="emphasis"><em>subclass</em></span> of the <code class="classname">Visitor</code>
|
|
||||||
class. Once the argument has been successfully parsed, the
|
|
||||||
<code class="classname">Visitor</code> for that argument is
|
|
||||||
called. Any data that needs to be operated on is declared in the
|
|
||||||
<code class="classname">Visitor</code> constructor and then operated on in the
|
|
||||||
<code class="methodname">visit()</code> method. A <code class="classname">Visitor</code>
|
|
||||||
is added to an <code class="classname">Arg</code> as the last argument in its
|
|
||||||
declaration. This may sound
|
|
||||||
complicated, but it is pretty straightforward. Let's see an
|
|
||||||
example.
|
|
||||||
</p><p>
|
|
||||||
Say you want to add an <em class="parameter"><code>--authors</code></em> flag to a program that
|
|
||||||
prints the names of the authors when present. First subclass
|
|
||||||
<code class="classname">Visitor</code>:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
#include "Visitor.h"
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
class AuthorVisitor : public Visitor
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
string _author;
|
|
||||||
public:
|
|
||||||
AuthorVisitor(const string& name ) : Visitor(), _author(name) {} ;
|
|
||||||
void visit() { cout << "AUTHOR: " << _author << endl; exit(0); };
|
|
||||||
};
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
Now include this class definition somewhere and go about creating
|
|
||||||
your command line. When you create the author switch, add the
|
|
||||||
<code class="classname">AuthorVisitor</code> pointer as follows:
|
|
||||||
|
|
||||||
</p><pre class="programlisting">
|
|
||||||
|
|
||||||
SwitchArg author("a","author","Prints author name", false,
|
|
||||||
new AuthorVisitor("Homer J. Simpson") );
|
|
||||||
cmd.add( author );
|
|
||||||
|
|
||||||
</pre><p>
|
|
||||||
|
|
||||||
Now, any time the <em class="parameter"><code>-a</code></em> or
|
|
||||||
<em class="parameter"><code>--author</code></em> flag is specified,
|
|
||||||
the program will print the author name, Homer J. Simpson and exit
|
|
||||||
without processing any further (as specified in the
|
|
||||||
<code class="methodname">visit()</code> method).
|
|
||||||
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="MORE_INFO"></a>More Information</h2></div></div></div><p>
|
|
||||||
For more information, look at the <a class="ulink" href="html/index.html" target="_top">
|
|
||||||
API Documentation</a> and the examples included with the
|
|
||||||
distribution.
|
|
||||||
</p><p>
|
|
||||||
<span class="emphasis"><em>Happy coding!</em></span>
|
|
||||||
</p></div></div></div></body></html>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,117 +0,0 @@
|
|||||||
/*
|
|
||||||
color:#ffffff; white
|
|
||||||
color:#e0e0e0; light gray
|
|
||||||
color:#f8f8f8; light gray
|
|
||||||
color:#003366; dark blue
|
|
||||||
color:#555555; gray
|
|
||||||
color:#ff9933; light orange
|
|
||||||
color:#cc3300; red/brown/orange
|
|
||||||
color:#660066; purple
|
|
||||||
color:#669900; green
|
|
||||||
*/
|
|
||||||
|
|
||||||
a {
|
|
||||||
color:#003366;
|
|
||||||
text-decoration:underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
color:#ff9933;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: verdana, tahoma, helvetica, arial, sans-serif;
|
|
||||||
font-size: 90%;
|
|
||||||
background-color:#ffffff;
|
|
||||||
margin: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
font-family: courier, serif;
|
|
||||||
background-color:#f8f8f8;
|
|
||||||
margin: 1.5em;
|
|
||||||
font-size:90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style: circle outside;
|
|
||||||
font-stretch:extra-expanded;
|
|
||||||
/* font-size:90%;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.menu { /* inherits from ul */
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
em {
|
|
||||||
color:#ff9933;
|
|
||||||
font-size:110%;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1,h2,h3{
|
|
||||||
color:#ff9933;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
border-color:#d0d0d0;
|
|
||||||
border-style:solid;
|
|
||||||
border-width:1px;
|
|
||||||
font-weight:bold;
|
|
||||||
padding: 0.2em;
|
|
||||||
background-color:#f8f8f8
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size:120%;
|
|
||||||
font-weight:bold;
|
|
||||||
border-bottom-style:solid;
|
|
||||||
border-bottom-width:1px;
|
|
||||||
border-bottom-color:#d0d0d0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size:110%;
|
|
||||||
font-weight:bold;
|
|
||||||
font-style:italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
tt {
|
|
||||||
font-family: courier, serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
tt.classname {
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
tt.constant {
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
p {
|
|
||||||
line-height: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
div.links{
|
|
||||||
float: left;
|
|
||||||
clear: left;
|
|
||||||
width: 12em;
|
|
||||||
background-color:#f8f8f8;
|
|
||||||
border-style:solid;
|
|
||||||
border-width:1px;
|
|
||||||
border-color:#d0d0d0;
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
|
||||||
margin: 0.5em 0.5em 0em 0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.main{
|
|
||||||
border-style:solid;
|
|
||||||
border-width:1px;
|
|
||||||
border-color:#d0d0d0;
|
|
||||||
margin: 0.5em 0em 0.5em 14em;
|
|
||||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
|
||||||
}
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
noinst_PROGRAMS = test1 test2 test3 test4 test5 test6 test7 test8 test9 \
|
|
||||||
test10 test11 test12 test13 test14 test15 test16 \
|
|
||||||
test17 test18 test19 test20 test21 test22 test23 test24 \
|
|
||||||
test25 test26 test27 test28 test29 test30
|
|
||||||
|
|
||||||
test1_SOURCES = test1.cpp
|
|
||||||
test2_SOURCES = test2.cpp
|
|
||||||
test3_SOURCES = test3.cpp
|
|
||||||
test4_SOURCES = test4.cpp
|
|
||||||
test5_SOURCES = test5.cpp
|
|
||||||
test6_SOURCES = test6.cpp
|
|
||||||
test7_SOURCES = test7.cpp
|
|
||||||
test8_SOURCES = test8.cpp
|
|
||||||
test9_SOURCES = test9.cpp
|
|
||||||
test10_SOURCES = test10.cpp
|
|
||||||
test11_SOURCES = test11.cpp
|
|
||||||
test12_SOURCES = test12.cpp
|
|
||||||
test13_SOURCES = test13.cpp
|
|
||||||
test14_SOURCES = test14.cpp
|
|
||||||
test15_SOURCES = test15.cpp
|
|
||||||
test16_SOURCES = test16.cpp
|
|
||||||
test17_SOURCES = test-hard-1.cpp test-hard-2.cpp
|
|
||||||
test18_SOURCES = test18.cpp
|
|
||||||
test19_SOURCES = test19.cpp
|
|
||||||
test20_SOURCES = test20.cpp
|
|
||||||
test21_SOURCES = test21.cpp
|
|
||||||
test22_SOURCES = test22.cpp
|
|
||||||
test23_SOURCES = test23.cpp
|
|
||||||
test24_SOURCES = test24.cpp
|
|
||||||
test25_SOURCES = test25.cpp
|
|
||||||
test26_SOURCES = test26.cpp
|
|
||||||
test27_SOURCES = test27.cpp
|
|
||||||
test28_SOURCES = test28.cpp
|
|
||||||
test29_SOURCES = test29.cpp
|
|
||||||
test30_SOURCES = test30.cpp
|
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
|
||||||
|
|
||||||
if HAVE_GNU_COMPILERS
|
|
||||||
AM_CXXFLAGS = -Wall -Wextra
|
|
||||||
endif
|
|
@ -1,902 +0,0 @@
|
|||||||
# 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 = :
|
|
||||||
noinst_PROGRAMS = test1$(EXEEXT) test2$(EXEEXT) test3$(EXEEXT) \
|
|
||||||
test4$(EXEEXT) test5$(EXEEXT) test6$(EXEEXT) test7$(EXEEXT) \
|
|
||||||
test8$(EXEEXT) test9$(EXEEXT) test10$(EXEEXT) test11$(EXEEXT) \
|
|
||||||
test12$(EXEEXT) test13$(EXEEXT) test14$(EXEEXT) \
|
|
||||||
test15$(EXEEXT) test16$(EXEEXT) test17$(EXEEXT) \
|
|
||||||
test18$(EXEEXT) test19$(EXEEXT) test20$(EXEEXT) \
|
|
||||||
test21$(EXEEXT) test22$(EXEEXT) test23$(EXEEXT) \
|
|
||||||
test24$(EXEEXT) test25$(EXEEXT) test26$(EXEEXT) \
|
|
||||||
test27$(EXEEXT) test28$(EXEEXT) test29$(EXEEXT) \
|
|
||||||
test30$(EXEEXT)
|
|
||||||
subdir = examples
|
|
||||||
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 $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
PROGRAMS = $(noinst_PROGRAMS)
|
|
||||||
am_test1_OBJECTS = test1.$(OBJEXT)
|
|
||||||
test1_OBJECTS = $(am_test1_OBJECTS)
|
|
||||||
test1_LDADD = $(LDADD)
|
|
||||||
am_test10_OBJECTS = test10.$(OBJEXT)
|
|
||||||
test10_OBJECTS = $(am_test10_OBJECTS)
|
|
||||||
test10_LDADD = $(LDADD)
|
|
||||||
am_test11_OBJECTS = test11.$(OBJEXT)
|
|
||||||
test11_OBJECTS = $(am_test11_OBJECTS)
|
|
||||||
test11_LDADD = $(LDADD)
|
|
||||||
am_test12_OBJECTS = test12.$(OBJEXT)
|
|
||||||
test12_OBJECTS = $(am_test12_OBJECTS)
|
|
||||||
test12_LDADD = $(LDADD)
|
|
||||||
am_test13_OBJECTS = test13.$(OBJEXT)
|
|
||||||
test13_OBJECTS = $(am_test13_OBJECTS)
|
|
||||||
test13_LDADD = $(LDADD)
|
|
||||||
am_test14_OBJECTS = test14.$(OBJEXT)
|
|
||||||
test14_OBJECTS = $(am_test14_OBJECTS)
|
|
||||||
test14_LDADD = $(LDADD)
|
|
||||||
am_test15_OBJECTS = test15.$(OBJEXT)
|
|
||||||
test15_OBJECTS = $(am_test15_OBJECTS)
|
|
||||||
test15_LDADD = $(LDADD)
|
|
||||||
am_test16_OBJECTS = test16.$(OBJEXT)
|
|
||||||
test16_OBJECTS = $(am_test16_OBJECTS)
|
|
||||||
test16_LDADD = $(LDADD)
|
|
||||||
am_test17_OBJECTS = test-hard-1.$(OBJEXT) test-hard-2.$(OBJEXT)
|
|
||||||
test17_OBJECTS = $(am_test17_OBJECTS)
|
|
||||||
test17_LDADD = $(LDADD)
|
|
||||||
am_test18_OBJECTS = test18.$(OBJEXT)
|
|
||||||
test18_OBJECTS = $(am_test18_OBJECTS)
|
|
||||||
test18_LDADD = $(LDADD)
|
|
||||||
am_test19_OBJECTS = test19.$(OBJEXT)
|
|
||||||
test19_OBJECTS = $(am_test19_OBJECTS)
|
|
||||||
test19_LDADD = $(LDADD)
|
|
||||||
am_test2_OBJECTS = test2.$(OBJEXT)
|
|
||||||
test2_OBJECTS = $(am_test2_OBJECTS)
|
|
||||||
test2_LDADD = $(LDADD)
|
|
||||||
am_test20_OBJECTS = test20.$(OBJEXT)
|
|
||||||
test20_OBJECTS = $(am_test20_OBJECTS)
|
|
||||||
test20_LDADD = $(LDADD)
|
|
||||||
am_test21_OBJECTS = test21.$(OBJEXT)
|
|
||||||
test21_OBJECTS = $(am_test21_OBJECTS)
|
|
||||||
test21_LDADD = $(LDADD)
|
|
||||||
am_test22_OBJECTS = test22.$(OBJEXT)
|
|
||||||
test22_OBJECTS = $(am_test22_OBJECTS)
|
|
||||||
test22_LDADD = $(LDADD)
|
|
||||||
am_test23_OBJECTS = test23.$(OBJEXT)
|
|
||||||
test23_OBJECTS = $(am_test23_OBJECTS)
|
|
||||||
test23_LDADD = $(LDADD)
|
|
||||||
am_test24_OBJECTS = test24.$(OBJEXT)
|
|
||||||
test24_OBJECTS = $(am_test24_OBJECTS)
|
|
||||||
test24_LDADD = $(LDADD)
|
|
||||||
am_test25_OBJECTS = test25.$(OBJEXT)
|
|
||||||
test25_OBJECTS = $(am_test25_OBJECTS)
|
|
||||||
test25_LDADD = $(LDADD)
|
|
||||||
am_test26_OBJECTS = test26.$(OBJEXT)
|
|
||||||
test26_OBJECTS = $(am_test26_OBJECTS)
|
|
||||||
test26_LDADD = $(LDADD)
|
|
||||||
am_test27_OBJECTS = test27.$(OBJEXT)
|
|
||||||
test27_OBJECTS = $(am_test27_OBJECTS)
|
|
||||||
test27_LDADD = $(LDADD)
|
|
||||||
am_test28_OBJECTS = test28.$(OBJEXT)
|
|
||||||
test28_OBJECTS = $(am_test28_OBJECTS)
|
|
||||||
test28_LDADD = $(LDADD)
|
|
||||||
am_test29_OBJECTS = test29.$(OBJEXT)
|
|
||||||
test29_OBJECTS = $(am_test29_OBJECTS)
|
|
||||||
test29_LDADD = $(LDADD)
|
|
||||||
am_test3_OBJECTS = test3.$(OBJEXT)
|
|
||||||
test3_OBJECTS = $(am_test3_OBJECTS)
|
|
||||||
test3_LDADD = $(LDADD)
|
|
||||||
am_test30_OBJECTS = test30.$(OBJEXT)
|
|
||||||
test30_OBJECTS = $(am_test30_OBJECTS)
|
|
||||||
test30_LDADD = $(LDADD)
|
|
||||||
am_test4_OBJECTS = test4.$(OBJEXT)
|
|
||||||
test4_OBJECTS = $(am_test4_OBJECTS)
|
|
||||||
test4_LDADD = $(LDADD)
|
|
||||||
am_test5_OBJECTS = test5.$(OBJEXT)
|
|
||||||
test5_OBJECTS = $(am_test5_OBJECTS)
|
|
||||||
test5_LDADD = $(LDADD)
|
|
||||||
am_test6_OBJECTS = test6.$(OBJEXT)
|
|
||||||
test6_OBJECTS = $(am_test6_OBJECTS)
|
|
||||||
test6_LDADD = $(LDADD)
|
|
||||||
am_test7_OBJECTS = test7.$(OBJEXT)
|
|
||||||
test7_OBJECTS = $(am_test7_OBJECTS)
|
|
||||||
test7_LDADD = $(LDADD)
|
|
||||||
am_test8_OBJECTS = test8.$(OBJEXT)
|
|
||||||
test8_OBJECTS = $(am_test8_OBJECTS)
|
|
||||||
test8_LDADD = $(LDADD)
|
|
||||||
am_test9_OBJECTS = test9.$(OBJEXT)
|
|
||||||
test9_OBJECTS = $(am_test9_OBJECTS)
|
|
||||||
test9_LDADD = $(LDADD)
|
|
||||||
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 =
|
|
||||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
|
|
||||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
|
||||||
am__maybe_remake_depfiles = depfiles
|
|
||||||
am__depfiles_remade = ./$(DEPDIR)/test-hard-1.Po \
|
|
||||||
./$(DEPDIR)/test-hard-2.Po ./$(DEPDIR)/test1.Po \
|
|
||||||
./$(DEPDIR)/test10.Po ./$(DEPDIR)/test11.Po \
|
|
||||||
./$(DEPDIR)/test12.Po ./$(DEPDIR)/test13.Po \
|
|
||||||
./$(DEPDIR)/test14.Po ./$(DEPDIR)/test15.Po \
|
|
||||||
./$(DEPDIR)/test16.Po ./$(DEPDIR)/test18.Po \
|
|
||||||
./$(DEPDIR)/test19.Po ./$(DEPDIR)/test2.Po \
|
|
||||||
./$(DEPDIR)/test20.Po ./$(DEPDIR)/test21.Po \
|
|
||||||
./$(DEPDIR)/test22.Po ./$(DEPDIR)/test23.Po \
|
|
||||||
./$(DEPDIR)/test24.Po ./$(DEPDIR)/test25.Po \
|
|
||||||
./$(DEPDIR)/test26.Po ./$(DEPDIR)/test27.Po \
|
|
||||||
./$(DEPDIR)/test28.Po ./$(DEPDIR)/test29.Po \
|
|
||||||
./$(DEPDIR)/test3.Po ./$(DEPDIR)/test30.Po \
|
|
||||||
./$(DEPDIR)/test4.Po ./$(DEPDIR)/test5.Po ./$(DEPDIR)/test6.Po \
|
|
||||||
./$(DEPDIR)/test7.Po ./$(DEPDIR)/test8.Po ./$(DEPDIR)/test9.Po
|
|
||||||
am__mv = mv -f
|
|
||||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
|
||||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
|
||||||
AM_V_CXX = $(am__v_CXX_@AM_V@)
|
|
||||||
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
|
|
||||||
am__v_CXX_0 = @echo " CXX " $@;
|
|
||||||
am__v_CXX_1 =
|
|
||||||
CXXLD = $(CXX)
|
|
||||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@
|
|
||||||
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
|
|
||||||
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
|
|
||||||
am__v_CXXLD_0 = @echo " CXXLD " $@;
|
|
||||||
am__v_CXXLD_1 =
|
|
||||||
SOURCES = $(test1_SOURCES) $(test10_SOURCES) $(test11_SOURCES) \
|
|
||||||
$(test12_SOURCES) $(test13_SOURCES) $(test14_SOURCES) \
|
|
||||||
$(test15_SOURCES) $(test16_SOURCES) $(test17_SOURCES) \
|
|
||||||
$(test18_SOURCES) $(test19_SOURCES) $(test2_SOURCES) \
|
|
||||||
$(test20_SOURCES) $(test21_SOURCES) $(test22_SOURCES) \
|
|
||||||
$(test23_SOURCES) $(test24_SOURCES) $(test25_SOURCES) \
|
|
||||||
$(test26_SOURCES) $(test27_SOURCES) $(test28_SOURCES) \
|
|
||||||
$(test29_SOURCES) $(test3_SOURCES) $(test30_SOURCES) \
|
|
||||||
$(test4_SOURCES) $(test5_SOURCES) $(test6_SOURCES) \
|
|
||||||
$(test7_SOURCES) $(test8_SOURCES) $(test9_SOURCES)
|
|
||||||
DIST_SOURCES = $(test1_SOURCES) $(test10_SOURCES) $(test11_SOURCES) \
|
|
||||||
$(test12_SOURCES) $(test13_SOURCES) $(test14_SOURCES) \
|
|
||||||
$(test15_SOURCES) $(test16_SOURCES) $(test17_SOURCES) \
|
|
||||||
$(test18_SOURCES) $(test19_SOURCES) $(test2_SOURCES) \
|
|
||||||
$(test20_SOURCES) $(test21_SOURCES) $(test22_SOURCES) \
|
|
||||||
$(test23_SOURCES) $(test24_SOURCES) $(test25_SOURCES) \
|
|
||||||
$(test26_SOURCES) $(test27_SOURCES) $(test28_SOURCES) \
|
|
||||||
$(test29_SOURCES) $(test3_SOURCES) $(test30_SOURCES) \
|
|
||||||
$(test4_SOURCES) $(test5_SOURCES) $(test6_SOURCES) \
|
|
||||||
$(test7_SOURCES) $(test8_SOURCES) $(test9_SOURCES)
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
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/depcomp \
|
|
||||||
$(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@
|
|
||||||
test1_SOURCES = test1.cpp
|
|
||||||
test2_SOURCES = test2.cpp
|
|
||||||
test3_SOURCES = test3.cpp
|
|
||||||
test4_SOURCES = test4.cpp
|
|
||||||
test5_SOURCES = test5.cpp
|
|
||||||
test6_SOURCES = test6.cpp
|
|
||||||
test7_SOURCES = test7.cpp
|
|
||||||
test8_SOURCES = test8.cpp
|
|
||||||
test9_SOURCES = test9.cpp
|
|
||||||
test10_SOURCES = test10.cpp
|
|
||||||
test11_SOURCES = test11.cpp
|
|
||||||
test12_SOURCES = test12.cpp
|
|
||||||
test13_SOURCES = test13.cpp
|
|
||||||
test14_SOURCES = test14.cpp
|
|
||||||
test15_SOURCES = test15.cpp
|
|
||||||
test16_SOURCES = test16.cpp
|
|
||||||
test17_SOURCES = test-hard-1.cpp test-hard-2.cpp
|
|
||||||
test18_SOURCES = test18.cpp
|
|
||||||
test19_SOURCES = test19.cpp
|
|
||||||
test20_SOURCES = test20.cpp
|
|
||||||
test21_SOURCES = test21.cpp
|
|
||||||
test22_SOURCES = test22.cpp
|
|
||||||
test23_SOURCES = test23.cpp
|
|
||||||
test24_SOURCES = test24.cpp
|
|
||||||
test25_SOURCES = test25.cpp
|
|
||||||
test26_SOURCES = test26.cpp
|
|
||||||
test27_SOURCES = test27.cpp
|
|
||||||
test28_SOURCES = test28.cpp
|
|
||||||
test29_SOURCES = test29.cpp
|
|
||||||
test30_SOURCES = test30.cpp
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
|
||||||
@HAVE_GNU_COMPILERS_TRUE@AM_CXXFLAGS = -Wall -Wextra
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .cpp .o .obj
|
|
||||||
$(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 examples/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu examples/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):
|
|
||||||
|
|
||||||
clean-noinstPROGRAMS:
|
|
||||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
|
||||||
|
|
||||||
test1$(EXEEXT): $(test1_OBJECTS) $(test1_DEPENDENCIES) $(EXTRA_test1_DEPENDENCIES)
|
|
||||||
@rm -f test1$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test1_OBJECTS) $(test1_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test10$(EXEEXT): $(test10_OBJECTS) $(test10_DEPENDENCIES) $(EXTRA_test10_DEPENDENCIES)
|
|
||||||
@rm -f test10$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test10_OBJECTS) $(test10_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test11$(EXEEXT): $(test11_OBJECTS) $(test11_DEPENDENCIES) $(EXTRA_test11_DEPENDENCIES)
|
|
||||||
@rm -f test11$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test11_OBJECTS) $(test11_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test12$(EXEEXT): $(test12_OBJECTS) $(test12_DEPENDENCIES) $(EXTRA_test12_DEPENDENCIES)
|
|
||||||
@rm -f test12$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test12_OBJECTS) $(test12_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test13$(EXEEXT): $(test13_OBJECTS) $(test13_DEPENDENCIES) $(EXTRA_test13_DEPENDENCIES)
|
|
||||||
@rm -f test13$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test13_OBJECTS) $(test13_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test14$(EXEEXT): $(test14_OBJECTS) $(test14_DEPENDENCIES) $(EXTRA_test14_DEPENDENCIES)
|
|
||||||
@rm -f test14$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test14_OBJECTS) $(test14_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test15$(EXEEXT): $(test15_OBJECTS) $(test15_DEPENDENCIES) $(EXTRA_test15_DEPENDENCIES)
|
|
||||||
@rm -f test15$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test15_OBJECTS) $(test15_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test16$(EXEEXT): $(test16_OBJECTS) $(test16_DEPENDENCIES) $(EXTRA_test16_DEPENDENCIES)
|
|
||||||
@rm -f test16$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test16_OBJECTS) $(test16_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test17$(EXEEXT): $(test17_OBJECTS) $(test17_DEPENDENCIES) $(EXTRA_test17_DEPENDENCIES)
|
|
||||||
@rm -f test17$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test17_OBJECTS) $(test17_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test18$(EXEEXT): $(test18_OBJECTS) $(test18_DEPENDENCIES) $(EXTRA_test18_DEPENDENCIES)
|
|
||||||
@rm -f test18$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test18_OBJECTS) $(test18_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test19$(EXEEXT): $(test19_OBJECTS) $(test19_DEPENDENCIES) $(EXTRA_test19_DEPENDENCIES)
|
|
||||||
@rm -f test19$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test19_OBJECTS) $(test19_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test2$(EXEEXT): $(test2_OBJECTS) $(test2_DEPENDENCIES) $(EXTRA_test2_DEPENDENCIES)
|
|
||||||
@rm -f test2$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test2_OBJECTS) $(test2_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test20$(EXEEXT): $(test20_OBJECTS) $(test20_DEPENDENCIES) $(EXTRA_test20_DEPENDENCIES)
|
|
||||||
@rm -f test20$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test20_OBJECTS) $(test20_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test21$(EXEEXT): $(test21_OBJECTS) $(test21_DEPENDENCIES) $(EXTRA_test21_DEPENDENCIES)
|
|
||||||
@rm -f test21$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test21_OBJECTS) $(test21_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test22$(EXEEXT): $(test22_OBJECTS) $(test22_DEPENDENCIES) $(EXTRA_test22_DEPENDENCIES)
|
|
||||||
@rm -f test22$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test22_OBJECTS) $(test22_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test23$(EXEEXT): $(test23_OBJECTS) $(test23_DEPENDENCIES) $(EXTRA_test23_DEPENDENCIES)
|
|
||||||
@rm -f test23$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test23_OBJECTS) $(test23_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test24$(EXEEXT): $(test24_OBJECTS) $(test24_DEPENDENCIES) $(EXTRA_test24_DEPENDENCIES)
|
|
||||||
@rm -f test24$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test24_OBJECTS) $(test24_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test25$(EXEEXT): $(test25_OBJECTS) $(test25_DEPENDENCIES) $(EXTRA_test25_DEPENDENCIES)
|
|
||||||
@rm -f test25$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test25_OBJECTS) $(test25_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test26$(EXEEXT): $(test26_OBJECTS) $(test26_DEPENDENCIES) $(EXTRA_test26_DEPENDENCIES)
|
|
||||||
@rm -f test26$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test26_OBJECTS) $(test26_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test27$(EXEEXT): $(test27_OBJECTS) $(test27_DEPENDENCIES) $(EXTRA_test27_DEPENDENCIES)
|
|
||||||
@rm -f test27$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test27_OBJECTS) $(test27_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test28$(EXEEXT): $(test28_OBJECTS) $(test28_DEPENDENCIES) $(EXTRA_test28_DEPENDENCIES)
|
|
||||||
@rm -f test28$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test28_OBJECTS) $(test28_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test29$(EXEEXT): $(test29_OBJECTS) $(test29_DEPENDENCIES) $(EXTRA_test29_DEPENDENCIES)
|
|
||||||
@rm -f test29$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test29_OBJECTS) $(test29_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test3$(EXEEXT): $(test3_OBJECTS) $(test3_DEPENDENCIES) $(EXTRA_test3_DEPENDENCIES)
|
|
||||||
@rm -f test3$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test3_OBJECTS) $(test3_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test30$(EXEEXT): $(test30_OBJECTS) $(test30_DEPENDENCIES) $(EXTRA_test30_DEPENDENCIES)
|
|
||||||
@rm -f test30$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test30_OBJECTS) $(test30_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test4$(EXEEXT): $(test4_OBJECTS) $(test4_DEPENDENCIES) $(EXTRA_test4_DEPENDENCIES)
|
|
||||||
@rm -f test4$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test4_OBJECTS) $(test4_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test5$(EXEEXT): $(test5_OBJECTS) $(test5_DEPENDENCIES) $(EXTRA_test5_DEPENDENCIES)
|
|
||||||
@rm -f test5$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test5_OBJECTS) $(test5_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test6$(EXEEXT): $(test6_OBJECTS) $(test6_DEPENDENCIES) $(EXTRA_test6_DEPENDENCIES)
|
|
||||||
@rm -f test6$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test6_OBJECTS) $(test6_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test7$(EXEEXT): $(test7_OBJECTS) $(test7_DEPENDENCIES) $(EXTRA_test7_DEPENDENCIES)
|
|
||||||
@rm -f test7$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test7_OBJECTS) $(test7_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test8$(EXEEXT): $(test8_OBJECTS) $(test8_DEPENDENCIES) $(EXTRA_test8_DEPENDENCIES)
|
|
||||||
@rm -f test8$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test8_OBJECTS) $(test8_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
test9$(EXEEXT): $(test9_OBJECTS) $(test9_DEPENDENCIES) $(EXTRA_test9_DEPENDENCIES)
|
|
||||||
@rm -f test9$(EXEEXT)
|
|
||||||
$(AM_V_CXXLD)$(CXXLINK) $(test9_OBJECTS) $(test9_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
mostlyclean-compile:
|
|
||||||
-rm -f *.$(OBJEXT)
|
|
||||||
|
|
||||||
distclean-compile:
|
|
||||||
-rm -f *.tab.c
|
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hard-1.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hard-2.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test1.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test10.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test11.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test12.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test13.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test14.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test15.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test16.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test18.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test19.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test2.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test20.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test21.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test22.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test23.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test24.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test25.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test26.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test27.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test28.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test29.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test3.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test30.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test4.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test5.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test6.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test7.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test8.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test9.Po@am__quote@ # am--include-marker
|
|
||||||
|
|
||||||
$(am__depfiles_remade):
|
|
||||||
@$(MKDIR_P) $(@D)
|
|
||||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
|
||||||
|
|
||||||
am--depfiles: $(am__depfiles_remade)
|
|
||||||
|
|
||||||
.cpp.o:
|
|
||||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
|
||||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
|
|
||||||
|
|
||||||
.cpp.obj:
|
|
||||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
|
||||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
|
||||||
|
|
||||||
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 $(PROGRAMS)
|
|
||||||
installdirs:
|
|
||||||
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 clean-noinstPROGRAMS mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f ./$(DEPDIR)/test-hard-1.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test-hard-2.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test1.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test10.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test11.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test12.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test13.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test14.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test15.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test16.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test18.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test19.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test2.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test20.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test21.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test22.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test23.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test24.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test25.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test26.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test27.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test28.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test29.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test3.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test30.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test4.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test5.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test6.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test7.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test8.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test9.Po
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-compile distclean-generic \
|
|
||||||
distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
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 ./$(DEPDIR)/test-hard-1.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test-hard-2.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test1.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test10.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test11.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test12.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test13.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test14.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test15.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test16.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test18.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test19.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test2.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test20.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test21.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test22.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test23.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test24.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test25.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test26.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test27.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test28.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test29.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test3.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test30.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test4.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test5.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test6.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test7.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test8.Po
|
|
||||||
-rm -f ./$(DEPDIR)/test9.Po
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
|
||||||
clean-generic clean-noinstPROGRAMS cscopelist-am ctags \
|
|
||||||
ctags-am distclean distclean-compile 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-man \
|
|
||||||
install-pdf install-pdf-am install-ps install-ps-am \
|
|
||||||
install-strip installcheck installcheck-am installdirs \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
|
||||||
tags tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.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:
|
|
@ -1,3 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <tclap/CmdLine.h>
|
|
@ -1,5 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <tclap/CmdLine.h>
|
|
||||||
|
|
||||||
int main() { }
|
|
@ -1,48 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
|
|
||||||
// Define a value argument and add it to the command line.
|
|
||||||
ValueArg<string> nameArg("n","name","Name to print",true,"homer","string");
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
// Define a switch and add it to the command line.
|
|
||||||
SwitchArg reverseSwitch("r","reverse","Print name backwards", false);
|
|
||||||
cmd.add( reverseSwitch );
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
// Get the value parsed by each arg.
|
|
||||||
string name = nameArg.getValue();
|
|
||||||
bool reverseName = reverseSwitch.getValue();
|
|
||||||
|
|
||||||
// Do what you intend too...
|
|
||||||
if ( reverseName )
|
|
||||||
{
|
|
||||||
reverse(name.begin(),name.end());
|
|
||||||
cout << "My name (spelled backwards) is: " << name << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "My name is: " << name << endl;
|
|
||||||
|
|
||||||
|
|
||||||
} catch (ArgException &e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
// Test only makes sure we can use different argv types for the
|
|
||||||
// parser. Don't run, just compile.
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
char *argv5[] = {(char*)"Foo", 0};
|
|
||||||
const char *argv6[] = {"Foo", 0};
|
|
||||||
const char * const argv7[] = {"Foo", 0};
|
|
||||||
char **argv1 = argv5;
|
|
||||||
const char **argv2 = argv6;
|
|
||||||
const char * const * argv3 = argv7;
|
|
||||||
const char * const * const argv4 = argv7;
|
|
||||||
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
cmd.parse(0, argv1);
|
|
||||||
cmd.parse(0, argv2);
|
|
||||||
cmd.parse(0, argv3);
|
|
||||||
cmd.parse(0, argv4);
|
|
||||||
cmd.parse(0, argv5);
|
|
||||||
cmd.parse(0, argv6);
|
|
||||||
cmd.parse(0, argv7);
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
|
|
||||||
// Define a simple 3D vector type
|
|
||||||
struct Vect3D {
|
|
||||||
double v[3];
|
|
||||||
|
|
||||||
// operator= will be used to assign to the vector
|
|
||||||
Vect3D& operator=(const std::string &str)
|
|
||||||
{
|
|
||||||
std::istringstream iss(str);
|
|
||||||
if (!(iss >> v[0] >> v[1] >> v[2]))
|
|
||||||
throw TCLAP::ArgParseException(str + " is not a 3D vector");
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& print(std::ostream &os) const
|
|
||||||
{
|
|
||||||
std::copy(v, v + 3, std::ostream_iterator<double>(os, " "));
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create an ArgTraits for the 3D vector type that declares it to be
|
|
||||||
// of string like type
|
|
||||||
namespace TCLAP {
|
|
||||||
template<>
|
|
||||||
struct ArgTraits<Vect3D> {
|
|
||||||
typedef StringLike ValueCategory;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
ValueArg<Vect3D> vec("v", "vect", "vector",
|
|
||||||
true, Vect3D(), "3D vector", cmd);
|
|
||||||
|
|
||||||
try {
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
} catch(std::exception &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec.getValue().print(std::cout);
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iterator>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
|
|
||||||
// Define a simple 3D vector type
|
|
||||||
struct Vect3D {
|
|
||||||
double v[3];
|
|
||||||
|
|
||||||
// operator= will be used to assign to the vector
|
|
||||||
Vect3D& operator=(const std::string &str)
|
|
||||||
{
|
|
||||||
std::istringstream iss(str);
|
|
||||||
if (!(iss >> v[0] >> v[1] >> v[2]))
|
|
||||||
throw TCLAP::ArgParseException(str + " is not a 3D vector");
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& print(std::ostream &os) const
|
|
||||||
{
|
|
||||||
std::copy(v, v + 3, std::ostream_iterator<double>(os, " "));
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream &os, const Vect3D &v)
|
|
||||||
{
|
|
||||||
return v.print(os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create an ArgTraits for the 3D vector type that declares it to be
|
|
||||||
// of string like type
|
|
||||||
namespace TCLAP {
|
|
||||||
template<>
|
|
||||||
struct ArgTraits<Vect3D> {
|
|
||||||
typedef StringLike ValueCategory;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
MultiArg<Vect3D> vec("v", "vect", "vector",
|
|
||||||
true, "3D vector", cmd);
|
|
||||||
|
|
||||||
try {
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
} catch(std::exception &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::copy(vec.begin(), vec.end(),
|
|
||||||
std::ostream_iterator<Vect3D>(std::cout, "\n"));
|
|
||||||
|
|
||||||
std::cout << "REVERSED" << std::endl;
|
|
||||||
|
|
||||||
// use alt. form getValue()
|
|
||||||
std::vector<Vect3D> v(vec.getValue());
|
|
||||||
std::reverse(v.begin(), v.end());
|
|
||||||
|
|
||||||
std::copy(v.begin(), v.end(),
|
|
||||||
std::ostream_iterator<Vect3D>(std::cout, "\n"));
|
|
||||||
}
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <tclap/CmdLine.h>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
|
|
||||||
//
|
|
||||||
// This file tests that we can parse args from a vector
|
|
||||||
// of strings rather than argv. This also tests a bug
|
|
||||||
// where a single element in the vector contains both
|
|
||||||
// the flag and value AND the value contains the flag
|
|
||||||
// from another switch arg. This would fool the parser
|
|
||||||
// into thinking that the string was a combined switches
|
|
||||||
// string rather than a flag value combo.
|
|
||||||
//
|
|
||||||
// This should not print an error
|
|
||||||
//
|
|
||||||
// Contributed by Nico Lugil.
|
|
||||||
//
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
CmdLine cmd("Test", ' ', "not versioned",true);
|
|
||||||
|
|
||||||
MultiArg<std::string> Arg("X","fli","fli module",false,"string");
|
|
||||||
cmd.add(Arg);
|
|
||||||
MultiSwitchArg ArgMultiSwitch("d","long_d","example");
|
|
||||||
cmd.add(ArgMultiSwitch);
|
|
||||||
|
|
||||||
std::vector<std::string> in;
|
|
||||||
in.push_back("prog name");
|
|
||||||
in.push_back("-X module");
|
|
||||||
cmd.parse(in);
|
|
||||||
|
|
||||||
std::vector<std::string> s = Arg.getValue();
|
|
||||||
for(unsigned int i = 0 ; i < s.size() ; i++)
|
|
||||||
{
|
|
||||||
std::cout << s[i] << "\n";
|
|
||||||
}
|
|
||||||
std::cout << "MultiSwtichArg was found " << ArgMultiSwitch.getValue() << " times.\n";
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (ArgException &e) // catch any exceptions
|
|
||||||
{
|
|
||||||
std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "done...\n";
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iterator>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
// Define a simple 3D vector type
|
|
||||||
template<typename T, size_t LEN>
|
|
||||||
struct Vect : public TCLAP::StringLikeTrait {
|
|
||||||
//typedef TCLAP::StringLike ValueCategory;
|
|
||||||
T v[LEN];
|
|
||||||
|
|
||||||
// operator= will be used to assign to the vector
|
|
||||||
Vect& operator=(const std::string &str)
|
|
||||||
{
|
|
||||||
std::istringstream iss(str);
|
|
||||||
for (size_t n = 0; n < LEN; n++) {
|
|
||||||
if (!(iss >> v[n])) {
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << " is not a vector of size " << LEN;
|
|
||||||
throw TCLAP::ArgParseException(str + oss.str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!iss.eof()) {
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << " is not a vector of size " << LEN;
|
|
||||||
throw TCLAP::ArgParseException(str + oss.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& print(std::ostream &os) const
|
|
||||||
{
|
|
||||||
std::copy(v, v + LEN, std::ostream_iterator<T>(os, ", "));
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
TCLAP::CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
TCLAP::ValueArg< Vect<double, 3> > vec("v", "vect", "vector",
|
|
||||||
true, Vect<double, 3>(),
|
|
||||||
"3D vector", cmd);
|
|
||||||
|
|
||||||
try {
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
} catch(std::exception &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec.getValue().print(std::cout);
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iterator>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
// Define a simple 3D vector type
|
|
||||||
template<typename T, size_t LEN>
|
|
||||||
struct Vect {
|
|
||||||
typedef TCLAP::StringLike ValueCategory;
|
|
||||||
T v[LEN];
|
|
||||||
|
|
||||||
// operator= will be used to assign to the vector
|
|
||||||
Vect& operator=(const std::string &str)
|
|
||||||
{
|
|
||||||
std::istringstream iss(str);
|
|
||||||
for (size_t n = 0; n < LEN; n++) {
|
|
||||||
if (!(iss >> v[n])) {
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << " is not a vector of size " << LEN;
|
|
||||||
throw TCLAP::ArgParseException(str + oss.str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!iss.eof()) {
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << " is not a vector of size " << LEN;
|
|
||||||
throw TCLAP::ArgParseException(str + oss.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream& print(std::ostream &os) const
|
|
||||||
{
|
|
||||||
std::copy(v, v + LEN, std::ostream_iterator<T>(os, " "));
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
TCLAP::CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
TCLAP::ValueArg< Vect<double, 3> > vec("v", "vect", "vector",
|
|
||||||
true, Vect<double, 3>(),
|
|
||||||
"3D vector", cmd);
|
|
||||||
|
|
||||||
try {
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
} catch(std::exception &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec.getValue().print(std::cout);
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iterator>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
template<>
|
|
||||||
struct ArgTraits< std::vector<double> > {
|
|
||||||
typedef StringLike ValueCategory;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
void SetString< std::vector<double> >(std::vector<double> &v,
|
|
||||||
const std::string &s)
|
|
||||||
{
|
|
||||||
std::istringstream iss(s);
|
|
||||||
while (iss) {
|
|
||||||
double tmp;
|
|
||||||
iss >> tmp;
|
|
||||||
v.push_back(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
TCLAP::CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
TCLAP::ValueArg< std::vector<double> > vec("v", "vect", "vector",
|
|
||||||
true, std::vector<double>(),
|
|
||||||
"3D vector", cmd);
|
|
||||||
try {
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
} catch(std::exception &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<double> &v = vec.getValue();
|
|
||||||
std::copy(v.begin(), v.end(),
|
|
||||||
std::ostream_iterator<double>(std::cout, "\n"));
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9", true);
|
|
||||||
|
|
||||||
cmd.setExceptionHandling(false);
|
|
||||||
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
|
|
||||||
} catch (ArgException &e) { // catch any exceptions
|
|
||||||
cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
|
|
||||||
return 1;
|
|
||||||
} catch (ExitException &e) { // catch any exceptions
|
|
||||||
cerr << "Exiting on ExitException." << endl;
|
|
||||||
return e.getExitStatus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define TCLAP_SETBASE_ZERO 1
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
|
|
||||||
ValueArg<int> itest("i", "intTest", "integer test", true, 5, "int");
|
|
||||||
cmd.add( itest );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
int _intTest = itest.getValue();
|
|
||||||
cout << "found int: " << _intTest << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int _intTest;
|
|
||||||
float _floatTest;
|
|
||||||
bool _boolTestA;
|
|
||||||
bool _boolTestB;
|
|
||||||
bool _boolTestC;
|
|
||||||
string _stringTest;
|
|
||||||
string _utest;
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv);
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
parseOptions(argc,argv);
|
|
||||||
|
|
||||||
cout << "for float we got : " << _floatTest << endl
|
|
||||||
<< "for int we got : " << _intTest<< endl
|
|
||||||
<< "for string we got : " << _stringTest<< endl
|
|
||||||
<< "for ulabeled we got : " << _utest << endl
|
|
||||||
<< "for bool A we got : " << _boolTestA << endl
|
|
||||||
<< "for bool B we got : " << _boolTestB << endl
|
|
||||||
<< "for bool C we got : " << _boolTestC << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define arguments
|
|
||||||
//
|
|
||||||
|
|
||||||
SwitchArg btest("B","existTestB", "tests for the existence of B", false);
|
|
||||||
cmd.add( btest );
|
|
||||||
|
|
||||||
SwitchArg ctest("C","existTestC", "tests for the existence of C", false);
|
|
||||||
cmd.add( ctest );
|
|
||||||
|
|
||||||
SwitchArg atest("A","existTestA", "tests for the existence of A", false);
|
|
||||||
cmd.add( atest );
|
|
||||||
|
|
||||||
ValueArg<string> stest("s","stringTest","string test",true,"homer",
|
|
||||||
"string");
|
|
||||||
cmd.add( stest );
|
|
||||||
|
|
||||||
ValueArg<int> itest("i", "intTest", "integer test", true, 5, "int");
|
|
||||||
cmd.add( itest );
|
|
||||||
|
|
||||||
ValueArg<double> ftest("f", "floatTest", "float test", false, 3.7, "float");
|
|
||||||
cmd.add( ftest );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> utest("unTest","unlabeld test", true,
|
|
||||||
"default","string");
|
|
||||||
cmd.add( utest );
|
|
||||||
|
|
||||||
UnlabeledMultiArg<string> mtest("fileName", "file names", false, "string");
|
|
||||||
cmd.add( mtest );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
_intTest = itest.getValue();
|
|
||||||
_floatTest = ftest.getValue();
|
|
||||||
_stringTest = stest.getValue();
|
|
||||||
_boolTestB = btest.getValue();
|
|
||||||
_boolTestC = ctest.getValue();
|
|
||||||
_boolTestA = atest.getValue();
|
|
||||||
_utest = utest.getValue();
|
|
||||||
|
|
||||||
vector<string> v = mtest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < v.size(); i++ )
|
|
||||||
cout << i << " " << v[i] << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <tclap/CmdLine.h>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message", '=', "0.9");
|
|
||||||
|
|
||||||
SwitchArg atmcSwitch("a", "atmc", "aContinuous time semantics", false);
|
|
||||||
SwitchArg btmcSwitch("b", "btmc", "bDiscrete time semantics", false);
|
|
||||||
cmd.xorAdd(atmcSwitch, btmcSwitch);
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
} catch (ArgException &e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
// This illustrates how to change the flag and name start strings.
|
|
||||||
// Note that these defines need to happen *before* tclap is included!
|
|
||||||
#define TCLAP_NAMESTARTSTRING "~~"
|
|
||||||
#define TCLAP_FLAGSTARTSTRING "/"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
|
|
||||||
// Define a value argument and add it to the command line.
|
|
||||||
ValueArg<string> nameArg("n","name","Name to print",true,"homer","string");
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
// Define a switch and add it to the command line.
|
|
||||||
SwitchArg reverseSwitch("r","reverse","Print name backwards", false);
|
|
||||||
cmd.add( reverseSwitch );
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
// Get the value parsed by each arg.
|
|
||||||
string name = nameArg.getValue();
|
|
||||||
bool reverseName = reverseSwitch.getValue();
|
|
||||||
|
|
||||||
// Do what you intend too...
|
|
||||||
if ( reverseName )
|
|
||||||
{
|
|
||||||
reverse(name.begin(),name.end());
|
|
||||||
cout << "My name (spelled backwards) is: " << name << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "My name is: " << name << endl;
|
|
||||||
|
|
||||||
|
|
||||||
} catch (ArgException &e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
|||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
cmd.ignoreUnmatched(true);
|
|
||||||
|
|
||||||
// Define a value argument and add it to the command line.
|
|
||||||
ValueArg<string> nameArg("n","name","Name to print",true,"homer","string");
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
// Define a switch and add it to the command line.
|
|
||||||
SwitchArg reverseSwitch("r","reverse","Print name backwards", false);
|
|
||||||
cmd.add( reverseSwitch );
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
// Get the value parsed by each arg.
|
|
||||||
string name = nameArg.getValue();
|
|
||||||
bool reverseName = reverseSwitch.getValue();
|
|
||||||
|
|
||||||
// Do what you intend too...
|
|
||||||
if ( reverseName )
|
|
||||||
{
|
|
||||||
reverse(name.begin(),name.end());
|
|
||||||
cout << "My name (spelled backwards) is: " << name << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "My name is: " << name << endl;
|
|
||||||
|
|
||||||
|
|
||||||
} catch (ArgException &e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
bool _boolTestB;
|
|
||||||
string _stringTest;
|
|
||||||
string _utest;
|
|
||||||
string _ztest;
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv);
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
parseOptions(argc,argv);
|
|
||||||
|
|
||||||
cout << "for string we got : " << _stringTest<< endl
|
|
||||||
<< "for bool B we got : " << _boolTestB << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", '=', "0.99" );
|
|
||||||
cmd.ignoreUnmatched(true);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define arguments
|
|
||||||
//
|
|
||||||
|
|
||||||
SwitchArg btest("B","existTestB", "exist Test B", cmd, false);
|
|
||||||
|
|
||||||
ValueArg<string> stest("s", "stringTest", "string test", true, "homer",
|
|
||||||
"string", cmd );
|
|
||||||
|
|
||||||
MultiArg<int> itest("i", "intTest", "multi int test", false,"int", cmd );
|
|
||||||
|
|
||||||
MultiArg<float> ftest("f", "floatTest", "multi float test", false,"float",
|
|
||||||
cmd );
|
|
||||||
|
|
||||||
UnlabeledMultiArg<string> mtest("fileName","file names", false,
|
|
||||||
"fileNameString", cmd);
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
_stringTest = stest.getValue();
|
|
||||||
_boolTestB = btest.getValue();
|
|
||||||
|
|
||||||
vector<int> vi = itest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < vi.size(); i++ )
|
|
||||||
cout << "[-i] " << i << " " << vi[i] << endl;
|
|
||||||
|
|
||||||
vector<float> vf = ftest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < vf.size(); i++ )
|
|
||||||
cout << "[-f] " << i << " " << vf[i] << endl;
|
|
||||||
|
|
||||||
vector<string> v = mtest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < v.size(); i++ )
|
|
||||||
cout << "[ ] " << i << " " << v[i] << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
// Test various Arg properties such as invalid flag/names
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
try { // Argument with two character 'flag'
|
|
||||||
ValueArg<string> nameArg("nx","name","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
|
|
||||||
try { // space as flag
|
|
||||||
ValueArg<string> nameArg(" ","name","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
|
|
||||||
try { // - as flag
|
|
||||||
ValueArg<string> nameArg("-","name","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
|
|
||||||
try { // -- as flag
|
|
||||||
ValueArg<string> nameArg("--","name","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
|
|
||||||
try { // space as name
|
|
||||||
ValueArg<string> nameArg("n"," ","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
|
|
||||||
try { // - as flag
|
|
||||||
ValueArg<string> nameArg("n","-","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
|
|
||||||
try { // -- as flag
|
|
||||||
ValueArg<string> nameArg("n","--","Name to print",true,
|
|
||||||
"homer","string");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
} catch(SpecificationException &e) {
|
|
||||||
cout << e.what() << std::endl; // Expected
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include "tclap/DocBookOutput.h"
|
|
||||||
#include "tclap/ZshCompletionOutput.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
DocBookOutput docoutput;
|
|
||||||
ZshCompletionOutput zshoutput;
|
|
||||||
CmdLineOutput *output = &zshoutput;
|
|
||||||
|
|
||||||
if (argc > 2)
|
|
||||||
output = &docoutput;
|
|
||||||
|
|
||||||
cmd.setOutput(output);
|
|
||||||
|
|
||||||
SwitchArg btest("B","sB", "exist Test B", false);
|
|
||||||
MultiArg<int> atest("A","sA", "exist Test A", false, "integer");
|
|
||||||
|
|
||||||
ValueArg<string> stest("s", "Bs", "string test", true, "homer",
|
|
||||||
"string");
|
|
||||||
|
|
||||||
cmd.xorAdd(stest, btest);
|
|
||||||
cmd.add( atest );
|
|
||||||
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
|||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
|
|
||||||
// Define a simple 3D vector type
|
|
||||||
struct Vect3D {
|
|
||||||
double v[3];
|
|
||||||
|
|
||||||
std::ostream& print(std::ostream &os) const
|
|
||||||
{
|
|
||||||
std::copy(v, v + 3, std::ostream_iterator<double>(os, " "));
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// operator>> will be used to assign to the vector since the default
|
|
||||||
// is that all types are ValueLike.
|
|
||||||
std::istream &operator>>(std::istream &is, Vect3D &v)
|
|
||||||
{
|
|
||||||
if (!(is >> v.v[0] >> v.v[1] >> v.v[2]))
|
|
||||||
throw TCLAP::ArgParseException(" Argument is not a 3D vector");
|
|
||||||
|
|
||||||
return is;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
ValueArg<Vect3D> vec("v", "vect", "vector",
|
|
||||||
true, Vect3D(), "3D vector", cmd);
|
|
||||||
|
|
||||||
try {
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
} catch(std::exception &e) {
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec.getValue().print(std::cout);
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
CmdLine cmd("test arg conversion operator");
|
|
||||||
SwitchArg falseSwitch("f","false", "test false condition", cmd, false);
|
|
||||||
SwitchArg trueSwitch("t","true", "tests true condition", cmd, true);
|
|
||||||
ValueArg<string> strArg("s","str", "test string arg", false, "defStr", "string", cmd);
|
|
||||||
ValueArg<int> intArg("i","int", "tests int arg", false, 4711, "integer", cmd);
|
|
||||||
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
|
|
||||||
string s = strArg;
|
|
||||||
int i = intArg;
|
|
||||||
|
|
||||||
cout << "for falseSwitch we got : " << falseSwitch << endl
|
|
||||||
<< "for trueSwitch we got : " << trueSwitch << endl
|
|
||||||
<< "for strArg we got : " << s << endl
|
|
||||||
<< "for intArg we got : " << i << endl;
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
CmdLine cmd("test constraint bug");
|
|
||||||
ValueArg<int> arg("i","int", "tests int arg", false, 4711, NULL, cmd);
|
|
||||||
cout << "Expected exception" << endl;
|
|
||||||
} catch(std::logic_error &e) { /* expected */ }
|
|
||||||
|
|
||||||
try {
|
|
||||||
CmdLine cmd("test constraint bug");
|
|
||||||
ValueArg<int> arg1("i","int", "tests int arg", false, 4711, NULL, NULL);
|
|
||||||
cout << "Expected exception" << endl;
|
|
||||||
} catch(std::logic_error &e) { /* expected */ }
|
|
||||||
|
|
||||||
try {
|
|
||||||
CmdLine cmd("test constraint bug");
|
|
||||||
MultiArg<int> arg1("i","int", "tests int arg", false, NULL, NULL);
|
|
||||||
cout << "Expected exception" << endl;
|
|
||||||
} catch(std::logic_error &e) { /* expected */ }
|
|
||||||
|
|
||||||
try {
|
|
||||||
CmdLine cmd("test constraint bug");
|
|
||||||
MultiArg<int> arg1("i","int", "tests int arg", false, NULL, cmd);
|
|
||||||
cout << "Expected exception" << endl;
|
|
||||||
} catch(std::logic_error &e) { /* expected */ }
|
|
||||||
|
|
||||||
cout << "Passed" << endl;
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
// https://sourceforge.net/p/tclap/bugs/30/
|
|
||||||
int main() {
|
|
||||||
CmdLine cmd("test empty argv");
|
|
||||||
std::vector<string> args;
|
|
||||||
cmd.parse(args);
|
|
||||||
}
|
|
@ -1,95 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
bool _boolTestB;
|
|
||||||
string _stringTest;
|
|
||||||
string _utest;
|
|
||||||
string _ztest;
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv);
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
parseOptions(argc,argv);
|
|
||||||
|
|
||||||
cout << "for string we got : " << _stringTest<< endl
|
|
||||||
<< "for ulabeled one we got : " << _utest << endl
|
|
||||||
<< "for ulabeled two we got : " << _ztest << endl
|
|
||||||
<< "for bool B we got : " << _boolTestB << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", '=', "0.99" );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define arguments
|
|
||||||
//
|
|
||||||
|
|
||||||
SwitchArg btest("B","existTestB", "exist Test B", false);
|
|
||||||
cmd.add( btest );
|
|
||||||
|
|
||||||
ValueArg<string> stest("", "stringTest", "string test", true, "homer",
|
|
||||||
"string");
|
|
||||||
cmd.add( stest );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> utest("unTest1","unlabeled test one", true,
|
|
||||||
"default","string");
|
|
||||||
cmd.add( utest );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> ztest("unTest2","unlabeled test two", true,
|
|
||||||
"default","string");
|
|
||||||
cmd.add( ztest );
|
|
||||||
|
|
||||||
MultiArg<int> itest("i", "intTest", "multi int test", false,"int" );
|
|
||||||
cmd.add( itest );
|
|
||||||
|
|
||||||
MultiArg<float> ftest("f", "floatTest", "multi float test", false,"float" );
|
|
||||||
cmd.add( ftest );
|
|
||||||
|
|
||||||
UnlabeledMultiArg<string> mtest("fileName","file names",false,
|
|
||||||
"fileNameString");
|
|
||||||
cmd.add( mtest );
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
_stringTest = stest.getValue();
|
|
||||||
_boolTestB = btest.getValue();
|
|
||||||
_utest = utest.getValue();
|
|
||||||
_ztest = ztest.getValue();
|
|
||||||
|
|
||||||
vector<int> vi = itest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < vi.size(); i++ )
|
|
||||||
cout << "[-i] " << i << " " << vi[i] << endl;
|
|
||||||
|
|
||||||
vector<float> vf = ftest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < vf.size(); i++ )
|
|
||||||
cout << "[-f] " << i << " " << vf[i] << endl;
|
|
||||||
|
|
||||||
vector<string> v = mtest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < v.size(); i++ )
|
|
||||||
cout << "[ ] " << i << " " << v[i] << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
// Example based on question in https://sourceforge.net/p/tclap/support-requests/2/
|
|
||||||
//
|
|
||||||
// Shows how to use a pair as a "custom type". Note that the argument
|
|
||||||
// flag must be specified, like -p "1 2.3" (with quotes).
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
// We need to tell TCLAP how to parse our pair, we assume it will be
|
|
||||||
// given as two arguments separated by whitespace.
|
|
||||||
std::istream &operator>>(std::istream &is, std::pair<int, double> &p) {
|
|
||||||
return is >> p.first >> p.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make it easy to print values of our type.
|
|
||||||
std::ostream &operator<<(std::ostream &os, const std::pair<int, double> &p) {
|
|
||||||
return os << p.first << ' ' << p.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
using namespace TCLAP;
|
|
||||||
|
|
||||||
// Our pair can now be used as any other type.
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
CmdLine cmd("test pair argument");
|
|
||||||
ValueArg<std::pair<int, double> > parg("p", "pair", "int,double pair",
|
|
||||||
true,
|
|
||||||
std::make_pair(0, 0.0),
|
|
||||||
"int,double",
|
|
||||||
cmd);
|
|
||||||
cmd.parse(argc, argv);
|
|
||||||
std::cout << parg.getValue() << std::endl;
|
|
||||||
}
|
|
@ -1,108 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include "tclap/DocBookOutput.h"
|
|
||||||
#include "tclap/ZshCompletionOutput.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
// This exemplifies how the output class can be overridden to provide
|
|
||||||
// user defined output.
|
|
||||||
class MyOutput : public StdOutput
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
virtual void failure(CmdLineInterface& c, ArgException& e)
|
|
||||||
{
|
|
||||||
static_cast<void>(c); // Ignore input, don't warn
|
|
||||||
cerr << "my failure message: " << endl
|
|
||||||
<< e.what() << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void usage(CmdLineInterface& c)
|
|
||||||
{
|
|
||||||
cout << "my usage message:" << endl;
|
|
||||||
list<Arg*> args = c.getArgList();
|
|
||||||
for (ArgListIterator it = args.begin(); it != args.end(); it++)
|
|
||||||
cout << (*it)->longID()
|
|
||||||
<< " (" << (*it)->getDescription() << ")" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void version(CmdLineInterface& c)
|
|
||||||
{
|
|
||||||
static_cast<void>(c); // Ignore input, don't warn
|
|
||||||
cout << "my version message: 0.1" << endl;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
bool _boolTestB;
|
|
||||||
bool _boolTestA;
|
|
||||||
string _stringTest;
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv);
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
parseOptions(argc,argv);
|
|
||||||
|
|
||||||
cout << "for string we got : " << _stringTest<< endl
|
|
||||||
<< "for bool B we got : " << _boolTestB << endl
|
|
||||||
<< "for bool A we got : " << _boolTestA << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
|
|
||||||
// set the output
|
|
||||||
MyOutput my;
|
|
||||||
//ZshCompletionOutput my;
|
|
||||||
//DocBookOutput my;
|
|
||||||
cmd.setOutput(&my);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define arguments
|
|
||||||
//
|
|
||||||
|
|
||||||
SwitchArg btest("B","sB", "exist Test B", false);
|
|
||||||
SwitchArg atest("A","sA", "exist Test A", false);
|
|
||||||
|
|
||||||
ValueArg<string> stest("s", "Bs", "string test", true, "homer",
|
|
||||||
"string");
|
|
||||||
cmd.add( stest );
|
|
||||||
cmd.add( btest );
|
|
||||||
cmd.add( atest );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
_stringTest = stest.getValue();
|
|
||||||
_boolTestB = btest.getValue();
|
|
||||||
_boolTestA = atest.getValue();
|
|
||||||
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,120 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
string _orTest;
|
|
||||||
string _orTest2;
|
|
||||||
string _testc;
|
|
||||||
bool _testd;
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv);
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
parseOptions(argc,argv);
|
|
||||||
|
|
||||||
cout << "for A OR B we got : " << _orTest<< endl
|
|
||||||
<< "for string C we got : " << _testc << endl
|
|
||||||
<< "for string D we got : " << _testd << endl
|
|
||||||
<< "for E or F or G we got: " << _orTest2 << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", ' ', "0.99" );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define arguments
|
|
||||||
//
|
|
||||||
|
|
||||||
ValueArg<string> atest("a", "aaa", "or test a", true, "homer", "string");
|
|
||||||
ValueArg<string> btest("b", "bbb", "or test b", true, "homer", "string");
|
|
||||||
cmd.xorAdd( atest, btest );
|
|
||||||
|
|
||||||
ValueArg<string> ctest("c", "ccc", "c test", true, "homer", "string");
|
|
||||||
cmd.add( ctest );
|
|
||||||
|
|
||||||
SwitchArg dtest("", "ddd", "d test", false);
|
|
||||||
cmd.add( dtest );
|
|
||||||
|
|
||||||
ValueArg<string> etest("", "eee", "e test", false, "homer", "string");
|
|
||||||
ValueArg<string> ftest("", "fff", "f test", false, "homer", "string");
|
|
||||||
ValueArg<string> gtest("g", "ggg", "g test", false, "homer", "string");
|
|
||||||
vector<Arg*> xorlist;
|
|
||||||
xorlist.push_back(&etest);
|
|
||||||
xorlist.push_back(&ftest);
|
|
||||||
xorlist.push_back(>est);
|
|
||||||
cmd.xorAdd( xorlist );
|
|
||||||
|
|
||||||
MultiArg<string> itest("i", "iii", "or test i", true, "string");
|
|
||||||
MultiArg<string> jtest("j", "jjj", "or test j", true, "string");
|
|
||||||
cmd.xorAdd( itest, jtest );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
|
|
||||||
if ( atest.isSet() )
|
|
||||||
_orTest = atest.getValue();
|
|
||||||
else if ( btest.isSet() )
|
|
||||||
_orTest = btest.getValue();
|
|
||||||
else
|
|
||||||
// Should never get here because TCLAP will note that one of the
|
|
||||||
// required args above has not been set.
|
|
||||||
throw("very bad things...");
|
|
||||||
|
|
||||||
_testc = ctest.getValue();
|
|
||||||
_testd = dtest.getValue();
|
|
||||||
|
|
||||||
if ( etest.isSet() )
|
|
||||||
_orTest2 = etest.getValue();
|
|
||||||
else if ( ftest.isSet() )
|
|
||||||
_orTest2 = ftest.getValue();
|
|
||||||
else if ( gtest.isSet() )
|
|
||||||
_orTest2 = gtest.getValue();
|
|
||||||
else
|
|
||||||
throw("still bad");
|
|
||||||
|
|
||||||
if ( jtest.isSet() )
|
|
||||||
{
|
|
||||||
cout << "for J:" << endl;
|
|
||||||
vector<string> v = jtest.getValue();
|
|
||||||
for ( int z = 0; static_cast<unsigned int>(z) < v.size(); z++ )
|
|
||||||
cout << " " << z << " " << v[z] << endl;
|
|
||||||
}
|
|
||||||
else if ( itest.isSet() )
|
|
||||||
{
|
|
||||||
cout << "for I:" << endl;
|
|
||||||
vector<string> v = itest.getValue();
|
|
||||||
for ( int z = 0; static_cast<unsigned int>(z) < v.size(); z++ )
|
|
||||||
cout << " " << z << " " << v[z] << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
throw("yup, still bad");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9");
|
|
||||||
|
|
||||||
vector<string> allowed;
|
|
||||||
allowed.push_back("homer");
|
|
||||||
allowed.push_back("marge");
|
|
||||||
allowed.push_back("bart");
|
|
||||||
allowed.push_back("lisa");
|
|
||||||
allowed.push_back("maggie");
|
|
||||||
ValuesConstraint<string> allowedVals( allowed );
|
|
||||||
|
|
||||||
ValueArg<string> nameArg("n","name","Name to print",true,"homer",
|
|
||||||
&allowedVals);
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
vector<int> iallowed;
|
|
||||||
iallowed.push_back(1);
|
|
||||||
iallowed.push_back(2);
|
|
||||||
iallowed.push_back(3);
|
|
||||||
ValuesConstraint<int> iallowedVals( iallowed );
|
|
||||||
|
|
||||||
UnlabeledValueArg<int> intArg("times","Number of times to print",true,1,
|
|
||||||
&iallowedVals,false);
|
|
||||||
cmd.add( intArg );
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
// Get the value parsed by each arg.
|
|
||||||
int num = intArg.getValue();
|
|
||||||
string name = nameArg.getValue();
|
|
||||||
|
|
||||||
for ( int i = 0; i < num; i++ )
|
|
||||||
cout << "My name is " << name << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
// Wrap everything in a try block. Do this every time,
|
|
||||||
// because exceptions will be thrown for problems.
|
|
||||||
try {
|
|
||||||
|
|
||||||
// Define the command line object.
|
|
||||||
CmdLine cmd("Command description message. This is a long multi-line message meant to test line wrapping. This is more text that doesn't really do anything besides take up lots of space that otherwise might be used for something real. That should be enough, don't you think?", ' ', "0.9");
|
|
||||||
|
|
||||||
vector<string> allowed;
|
|
||||||
allowed.push_back("homer");
|
|
||||||
allowed.push_back("marge");
|
|
||||||
allowed.push_back("bart");
|
|
||||||
allowed.push_back("lisa");
|
|
||||||
allowed.push_back("maggie");
|
|
||||||
ValuesConstraint<string> vallowed( allowed );
|
|
||||||
|
|
||||||
MultiArg<string> nameArg("n","name","Name to print. This is a long, nonsensical message to test line wrapping. Hopefully it works.",true,&vallowed);
|
|
||||||
cmd.add( nameArg );
|
|
||||||
|
|
||||||
vector<int> iallowed;
|
|
||||||
iallowed.push_back(1);
|
|
||||||
iallowed.push_back(2);
|
|
||||||
iallowed.push_back(3);
|
|
||||||
ValuesConstraint<int> iiallowed( iallowed );
|
|
||||||
|
|
||||||
UnlabeledMultiArg<int> intArg("times","Number of times to print",false,
|
|
||||||
&iiallowed);
|
|
||||||
cmd.add( intArg );
|
|
||||||
|
|
||||||
// Ignore the names and comments! These args mean nothing (to this
|
|
||||||
// program) and are here solely to take up space.
|
|
||||||
ValueArg<int> gapCreate("f","gapCreate", "The cost of creating a gap",
|
|
||||||
false, -10, "negative int");
|
|
||||||
cmd.add( gapCreate );
|
|
||||||
|
|
||||||
ValueArg<int> gapExtend("g","gap-Extend",
|
|
||||||
"The cost for each extension of a gap", false, -2, "negative int");
|
|
||||||
cmd.add( gapExtend );
|
|
||||||
|
|
||||||
SwitchArg dna("d","isDna","The input sequences are DNA", false);
|
|
||||||
cmd.add( dna );
|
|
||||||
|
|
||||||
ValueArg<string> scoringMatrixName("s","scoring--Matrix",
|
|
||||||
"Scoring Matrix name", false,"BLOSUM50","name string");
|
|
||||||
cmd.add( scoringMatrixName );
|
|
||||||
|
|
||||||
ValueArg<string> seq1Filename ("x","filename1",
|
|
||||||
"Sequence 1 filename (FASTA format)", false,"","filename");
|
|
||||||
cmd.add( seq1Filename );
|
|
||||||
|
|
||||||
ValueArg<string> seq2Filename ("z","filename2",
|
|
||||||
"Sequence 2 filename (FASTA format)", false,"","filename");
|
|
||||||
cmd.add( seq2Filename );
|
|
||||||
|
|
||||||
ValueArg<float> lowerBound("b","lowerBound", "lower percentage bound",
|
|
||||||
false,1.0,"float lte 1");
|
|
||||||
cmd.add( lowerBound );
|
|
||||||
|
|
||||||
ValueArg<float> upperBound("u","upperBound", "upper percentage bound",
|
|
||||||
false,1.0,"float lte 1");
|
|
||||||
cmd.add( upperBound );
|
|
||||||
|
|
||||||
ValueArg<int> limit("l","limit","Max number of alignments allowed",
|
|
||||||
false, 1000,"int");
|
|
||||||
cmd.add( limit );
|
|
||||||
|
|
||||||
argv[0] = const_cast<char*>("ThisIsAVeryLongProgramNameDesignedToTestSpacePrintWhichUsedToHaveProblemsWithLongProgramNamesIThinkItIsNowLongEnough");
|
|
||||||
|
|
||||||
// Parse the args.
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
// Get the value parsed by each arg.
|
|
||||||
vector<int> num = intArg.getValue();
|
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < num.size(); i++ )
|
|
||||||
cout << "Got num " << num[i] << endl;
|
|
||||||
|
|
||||||
vector<string> name = nameArg.getValue();
|
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < name.size(); i++ )
|
|
||||||
cout << "Got name " << name[i] << endl;
|
|
||||||
|
|
||||||
|
|
||||||
} catch (ArgException& e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
bool _boolTestB;
|
|
||||||
string _stringTest;
|
|
||||||
string _utest;
|
|
||||||
string _ztest;
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv);
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
|
|
||||||
parseOptions(argc,argv);
|
|
||||||
|
|
||||||
cout << "for string we got : " << _stringTest<< endl
|
|
||||||
<< "for ulabeled one we got : " << _utest << endl
|
|
||||||
<< "for ulabeled two we got : " << _ztest << endl
|
|
||||||
<< "for bool B we got : " << _boolTestB << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void parseOptions(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("this is a message", '=', "0.99" );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define arguments
|
|
||||||
//
|
|
||||||
|
|
||||||
SwitchArg btest("B","existTestB", "exist Test B", cmd, false);
|
|
||||||
|
|
||||||
ValueArg<string> stest("s", "stringTest", "string test", true, "homer",
|
|
||||||
"string", cmd );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> utest("unTest1","unlabeled test one", true,
|
|
||||||
"default","string", cmd );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> ztest("unTest2","unlabeled test two", true,
|
|
||||||
"default","string", cmd );
|
|
||||||
|
|
||||||
MultiArg<int> itest("i", "intTest", "multi int test", false,"int", cmd );
|
|
||||||
|
|
||||||
MultiArg<float> ftest("f", "floatTest", "multi float test", false,"float",
|
|
||||||
cmd );
|
|
||||||
|
|
||||||
UnlabeledMultiArg<string> mtest("fileName","file names", false,
|
|
||||||
"fileNameString", cmd);
|
|
||||||
//
|
|
||||||
// Parse the command line.
|
|
||||||
//
|
|
||||||
cmd.parse(argc,argv);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set variables
|
|
||||||
//
|
|
||||||
_stringTest = stest.getValue();
|
|
||||||
_boolTestB = btest.getValue();
|
|
||||||
_utest = utest.getValue();
|
|
||||||
_ztest = ztest.getValue();
|
|
||||||
|
|
||||||
vector<int> vi = itest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < vi.size(); i++ )
|
|
||||||
cout << "[-i] " << i << " " << vi[i] << endl;
|
|
||||||
|
|
||||||
vector<float> vf = ftest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < vf.size(); i++ )
|
|
||||||
cout << "[-f] " << i << " " << vf[i] << endl;
|
|
||||||
|
|
||||||
vector<string> v = mtest.getValue();
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < v.size(); i++ )
|
|
||||||
cout << "[ ] " << i << " " << v[i] << endl;
|
|
||||||
|
|
||||||
} catch ( ArgException& e )
|
|
||||||
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
|
|
||||||
using namespace TCLAP;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
CmdLine cmd("Command description message", ' ', "0.9",false);
|
|
||||||
|
|
||||||
SwitchArg reverseSwitch("r","reverse","REVERSE instead of FORWARDS", false);
|
|
||||||
cmd.add( reverseSwitch );
|
|
||||||
|
|
||||||
MultiSwitchArg verbose("V","verbose","Level of verbosity");
|
|
||||||
cmd.add( verbose );
|
|
||||||
|
|
||||||
MultiSwitchArg noise("N","noise","Level of noise",5);
|
|
||||||
cmd.add( noise );
|
|
||||||
|
|
||||||
UnlabeledValueArg<string> word("word","a random word", false, "string",
|
|
||||||
"won't see this",false);
|
|
||||||
cmd.add( word );
|
|
||||||
|
|
||||||
// Uncommenting the next arg will (correctly) cause an exception
|
|
||||||
// to be thrown.
|
|
||||||
|
|
||||||
// UnlabeledMultiArg<string> badword("badword","a bad word", false,"string");
|
|
||||||
//
|
|
||||||
// cmd.add( badword );
|
|
||||||
|
|
||||||
cmd.parse( argc, argv );
|
|
||||||
|
|
||||||
bool reverseName = reverseSwitch.getValue();
|
|
||||||
|
|
||||||
if ( reverseName )
|
|
||||||
cout << "REVERSE" << endl;
|
|
||||||
else
|
|
||||||
cout << "FORWARD" << endl;
|
|
||||||
|
|
||||||
if ( verbose.isSet() )
|
|
||||||
cout << "Verbose level: " << verbose.getValue() << endl;
|
|
||||||
|
|
||||||
if ( noise.isSet() )
|
|
||||||
cout << "Noise level: " << noise.getValue() << endl;
|
|
||||||
|
|
||||||
if ( word.isSet() )
|
|
||||||
cout << "Word: " << word.getValue() << endl;
|
|
||||||
|
|
||||||
} catch (ArgException &e) // catch any exceptions
|
|
||||||
{ cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
SUBDIRS = tclap
|
|
@ -1,588 +0,0 @@
|
|||||||
# 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
|
|
||||||
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 $(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 =
|
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
|
||||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
|
||||||
install-data-recursive install-dvi-recursive \
|
|
||||||
install-exec-recursive install-html-recursive \
|
|
||||||
install-info-recursive install-pdf-recursive \
|
|
||||||
install-ps-recursive install-recursive installcheck-recursive \
|
|
||||||
installdirs-recursive pdf-recursive ps-recursive \
|
|
||||||
tags-recursive uninstall-recursive
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
|
||||||
distclean-recursive maintainer-clean-recursive
|
|
||||||
am__recursive_targets = \
|
|
||||||
$(RECURSIVE_TARGETS) \
|
|
||||||
$(RECURSIVE_CLEAN_TARGETS) \
|
|
||||||
$(am__extra_recursive_targets)
|
|
||||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
|
||||||
distdir distdir-am
|
|
||||||
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)`
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
|
||||||
$(top_srcdir)/config/mkinstalldirs
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
am__relativize = \
|
|
||||||
dir0=`pwd`; \
|
|
||||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
|
||||||
sed_rest='s,^[^/]*/*,,'; \
|
|
||||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
|
||||||
sed_butlast='s,/*[^/]*$$,,'; \
|
|
||||||
while test -n "$$dir1"; do \
|
|
||||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first" != "."; then \
|
|
||||||
if test "$$first" = ".."; then \
|
|
||||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
|
||||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
|
||||||
else \
|
|
||||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first2" = "$$first"; then \
|
|
||||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
|
||||||
else \
|
|
||||||
dir2="../$$dir2"; \
|
|
||||||
fi; \
|
|
||||||
dir0="$$dir0"/"$$first"; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
|
||||||
done; \
|
|
||||||
reldir="$$dir2"
|
|
||||||
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@
|
|
||||||
SUBDIRS = tclap
|
|
||||||
all: all-recursive
|
|
||||||
|
|
||||||
.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/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu include/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):
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
|
||||||
# into them and run 'make' without going through this Makefile.
|
|
||||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
|
||||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
|
||||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
|
||||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
|
||||||
$(am__recursive_targets):
|
|
||||||
@fail=; \
|
|
||||||
if $(am__make_keepgoing); then \
|
|
||||||
failcom='fail=yes'; \
|
|
||||||
else \
|
|
||||||
failcom='exit 1'; \
|
|
||||||
fi; \
|
|
||||||
dot_seen=no; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
case "$@" in \
|
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
dot_seen=yes; \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| eval $$failcom; \
|
|
||||||
done; \
|
|
||||||
if test "$$dot_seen" = "no"; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|
||||||
fi; test -z "$$fail"
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-recursive
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
|
||||||
include_option=--etags-include; \
|
|
||||||
empty_fix=.; \
|
|
||||||
else \
|
|
||||||
include_option=--include; \
|
|
||||||
empty_fix=; \
|
|
||||||
fi; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test ! -f $$subdir/TAGS || \
|
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
$(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-recursive
|
|
||||||
|
|
||||||
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-recursive
|
|
||||||
|
|
||||||
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
|
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
$(am__make_dryrun) \
|
|
||||||
|| test -d "$(distdir)/$$subdir" \
|
|
||||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|
||||||
|| exit 1; \
|
|
||||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_distdir=$$reldir; \
|
|
||||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_top_distdir=$$reldir; \
|
|
||||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
|
||||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
|
||||||
($(am__cd) $$subdir && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$$new_top_distdir" \
|
|
||||||
distdir="$$new_distdir" \
|
|
||||||
am__remove_distdir=: \
|
|
||||||
am__skip_length_check=: \
|
|
||||||
am__skip_mode_fix=: \
|
|
||||||
distdir) \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-recursive
|
|
||||||
all-am: Makefile
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
installdirs-am:
|
|
||||||
install: install-recursive
|
|
||||||
install-exec: install-exec-recursive
|
|
||||||
install-data: install-data-recursive
|
|
||||||
uninstall: uninstall-recursive
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
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-recursive
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-recursive
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-dvi: install-dvi-recursive
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-recursive
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-recursive
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-recursive
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-recursive
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-recursive
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-recursive
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: $(am__recursive_targets) 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-man install-pdf install-pdf-am \
|
|
||||||
install-ps install-ps-am install-strip installcheck \
|
|
||||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
|
||||||
pdf-am ps ps-am tags tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.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:
|
|
@ -1,683 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: Arg.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno .
|
|
||||||
* Copyright (c) 2017 Google Inc.
|
|
||||||
* 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,
|
|
||||||
* 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_ARGUMENT_H
|
|
||||||
#define TCLAP_ARGUMENT_H
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
#include <tclap/sstream.h>
|
|
||||||
|
|
||||||
#include <tclap/ArgException.h>
|
|
||||||
#include <tclap/Visitor.h>
|
|
||||||
#include <tclap/CmdLineInterface.h>
|
|
||||||
#include <tclap/ArgTraits.h>
|
|
||||||
#include <tclap/StandardTraits.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A virtual base class that defines the essential data for all arguments.
|
|
||||||
* This class, or one of its existing children, must be subclassed to do
|
|
||||||
* anything.
|
|
||||||
*/
|
|
||||||
class Arg
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying.
|
|
||||||
*/
|
|
||||||
Arg(const Arg& rhs);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying.
|
|
||||||
*/
|
|
||||||
Arg& operator=(const Arg& rhs);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the rest of the arguments should be ignored.
|
|
||||||
*/
|
|
||||||
static bool& ignoreRestRef() { static bool ign = false; return ign; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The delimiter that separates an argument flag/name from the
|
|
||||||
* value.
|
|
||||||
*/
|
|
||||||
static char& delimiterRef() { static char delim = ' '; return delim; }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The single char flag used to identify the argument.
|
|
||||||
* This value (preceded by a dash {-}), can be used to identify
|
|
||||||
* an argument on the command line. The _flag can be blank,
|
|
||||||
* in fact this is how unlabeled args work. Unlabeled args must
|
|
||||||
* override appropriate functions to get correct handling. Note
|
|
||||||
* that the _flag does NOT include the dash as part of the flag.
|
|
||||||
*/
|
|
||||||
std::string _flag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A single word namd identifying the argument.
|
|
||||||
* This value (preceded by two dashed {--}) can also be used
|
|
||||||
* to identify an argument on the command line. Note that the
|
|
||||||
* _name does NOT include the two dashes as part of the _name. The
|
|
||||||
* _name cannot be blank.
|
|
||||||
*/
|
|
||||||
std::string _name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Description of the argument.
|
|
||||||
*/
|
|
||||||
std::string _description;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicating whether the argument is required.
|
|
||||||
*/
|
|
||||||
bool _required;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Label to be used in usage description. Normally set to
|
|
||||||
* "required", but can be changed when necessary.
|
|
||||||
*/
|
|
||||||
std::string _requireLabel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether a value is required for the argument.
|
|
||||||
* Note that the value may be required but the argument/value
|
|
||||||
* combination may not be, as specified by _required.
|
|
||||||
*/
|
|
||||||
bool _valueRequired;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the argument has been set.
|
|
||||||
* Indicates that a value on the command line has matched the
|
|
||||||
* name/flag of this argument and the values have been set accordingly.
|
|
||||||
*/
|
|
||||||
bool _alreadySet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A pointer to a visitor object.
|
|
||||||
* The visitor allows special handling to occur as soon as the
|
|
||||||
* argument is matched. This defaults to NULL and should not
|
|
||||||
* be used unless absolutely necessary.
|
|
||||||
*/
|
|
||||||
Visitor* _visitor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether this argument can be ignored, if desired.
|
|
||||||
*/
|
|
||||||
bool _ignoreable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates that the arg was set as part of an XOR and not on the
|
|
||||||
* command line.
|
|
||||||
*/
|
|
||||||
bool _xorSet;
|
|
||||||
|
|
||||||
bool _acceptsMultipleValues;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs the special handling described by the Visitor.
|
|
||||||
*/
|
|
||||||
void _checkWithVisitor() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Primary constructor. YOU (yes you) should NEVER construct an Arg
|
|
||||||
* directly, this is a base class that is extended by various children
|
|
||||||
* that are meant to be used. Use SwitchArg, ValueArg, MultiArg,
|
|
||||||
* UnlabeledValueArg, or UnlabeledMultiArg instead.
|
|
||||||
*
|
|
||||||
* \param flag - The flag identifying the argument.
|
|
||||||
* \param name - The name identifying the argument.
|
|
||||||
* \param desc - The description of the argument, used in the usage.
|
|
||||||
* \param req - Whether the argument is required.
|
|
||||||
* \param valreq - Whether the a value is required for the argument.
|
|
||||||
* \param v - The visitor checked by the argument. Defaults to NULL.
|
|
||||||
*/
|
|
||||||
Arg( const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
bool valreq,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Destructor.
|
|
||||||
*/
|
|
||||||
virtual ~Arg();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds this to the specified list of Args.
|
|
||||||
* \param argList - The list to add this to.
|
|
||||||
*/
|
|
||||||
virtual void addToList( std::list<Arg*>& argList ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Begin ignoring arguments since the "--" argument was specified.
|
|
||||||
*/
|
|
||||||
static void beginIgnoring() { ignoreRestRef() = true; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to ignore the rest.
|
|
||||||
*/
|
|
||||||
static bool ignoreRest() { return ignoreRestRef(); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The delimiter that separates an argument flag/name from the
|
|
||||||
* value.
|
|
||||||
*/
|
|
||||||
static char delimiter() { return delimiterRef(); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The char used as a place holder when SwitchArgs are combined.
|
|
||||||
* Currently set to the bell char (ASCII 7).
|
|
||||||
*/
|
|
||||||
static char blankChar() { return (char)7; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The char that indicates the beginning of a flag. Defaults to '-', but
|
|
||||||
* clients can define TCLAP_FLAGSTARTCHAR to override.
|
|
||||||
*/
|
|
||||||
#ifndef TCLAP_FLAGSTARTCHAR
|
|
||||||
#define TCLAP_FLAGSTARTCHAR '-'
|
|
||||||
#endif
|
|
||||||
static char flagStartChar() { return TCLAP_FLAGSTARTCHAR; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The sting that indicates the beginning of a flag. Defaults to "-", but
|
|
||||||
* clients can define TCLAP_FLAGSTARTSTRING to override. Should be the same
|
|
||||||
* as TCLAP_FLAGSTARTCHAR.
|
|
||||||
*/
|
|
||||||
#ifndef TCLAP_FLAGSTARTSTRING
|
|
||||||
#define TCLAP_FLAGSTARTSTRING "-"
|
|
||||||
#endif
|
|
||||||
static const std::string flagStartString() { return TCLAP_FLAGSTARTSTRING; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The sting that indicates the beginning of a name. Defaults to "--", but
|
|
||||||
* clients can define TCLAP_NAMESTARTSTRING to override.
|
|
||||||
*/
|
|
||||||
#ifndef TCLAP_NAMESTARTSTRING
|
|
||||||
#define TCLAP_NAMESTARTSTRING "--"
|
|
||||||
#endif
|
|
||||||
static const std::string nameStartString() { return TCLAP_NAMESTARTSTRING; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The name used to identify the ignore rest argument.
|
|
||||||
*/
|
|
||||||
static const std::string ignoreNameString() { return "ignore_rest"; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the delimiter for all arguments.
|
|
||||||
* \param c - The character that delimits flags/names from values.
|
|
||||||
*/
|
|
||||||
static void setDelimiter( char c ) { delimiterRef() = c; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pure virtual method meant to handle the parsing and value assignment
|
|
||||||
* of the string on the command line.
|
|
||||||
* \param i - Pointer the the current argument in the list.
|
|
||||||
* \param args - Mutable list of strings. What is
|
|
||||||
* passed in from main.
|
|
||||||
*/
|
|
||||||
virtual bool processArg(int *i, std::vector<std::string>& args) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Operator ==.
|
|
||||||
* Equality operator. Must be virtual to handle unlabeled args.
|
|
||||||
* \param a - The Arg to be compared to this.
|
|
||||||
*/
|
|
||||||
virtual bool operator==(const Arg& a) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the argument flag.
|
|
||||||
*/
|
|
||||||
const std::string& getFlag() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the argument name.
|
|
||||||
*/
|
|
||||||
const std::string& getName() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the argument description.
|
|
||||||
*/
|
|
||||||
std::string getDescription() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the argument is required.
|
|
||||||
*/
|
|
||||||
virtual bool isRequired() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets _required to true. This is used by the XorHandler.
|
|
||||||
* You really have no reason to ever use it.
|
|
||||||
*/
|
|
||||||
void forceRequired();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the _alreadySet value to true. This is used by the XorHandler.
|
|
||||||
* You really have no reason to ever use it.
|
|
||||||
*/
|
|
||||||
void xorSet();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether a value must be specified for argument.
|
|
||||||
*/
|
|
||||||
bool isValueRequired() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the argument has already been set. Only true
|
|
||||||
* if the arg has been matched on the command line.
|
|
||||||
*/
|
|
||||||
bool isSet() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the argument can be ignored, if desired.
|
|
||||||
*/
|
|
||||||
bool isIgnoreable() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A method that tests whether a string matches this argument.
|
|
||||||
* This is generally called by the processArg() method. This
|
|
||||||
* method could be re-implemented by a child to change how
|
|
||||||
* arguments are specified on the command line.
|
|
||||||
* \param s - The string to be compared to the flag/name to determine
|
|
||||||
* whether the arg matches.
|
|
||||||
*/
|
|
||||||
virtual bool argMatches( const std::string& s ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a simple string representation of the argument.
|
|
||||||
* Primarily for debugging.
|
|
||||||
*/
|
|
||||||
virtual std::string toString() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a short ID for the usage.
|
|
||||||
* \param valueId - The value used in the id.
|
|
||||||
*/
|
|
||||||
virtual std::string shortID( const std::string& valueId = "val" ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a long ID for the usage.
|
|
||||||
* \param valueId - The value used in the id.
|
|
||||||
*/
|
|
||||||
virtual std::string longID( const std::string& valueId = "val" ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Trims a value off of the flag.
|
|
||||||
* \param flag - The string from which the flag and value will be
|
|
||||||
* trimmed. Contains the flag once the value has been trimmed.
|
|
||||||
* \param value - Where the value trimmed from the string will
|
|
||||||
* be stored.
|
|
||||||
*/
|
|
||||||
virtual void trimFlag( std::string& flag, std::string& value ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether a given string has blank chars, indicating that
|
|
||||||
* it is a combined SwitchArg. If so, return true, otherwise return
|
|
||||||
* false.
|
|
||||||
* \param s - string to be checked.
|
|
||||||
*/
|
|
||||||
bool _hasBlanks( const std::string& s ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the requireLabel. Used by XorHandler. You shouldn't ever
|
|
||||||
* use this.
|
|
||||||
* \param s - Set the requireLabel to this value.
|
|
||||||
*/
|
|
||||||
void setRequireLabel( const std::string& s );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used for MultiArgs and XorHandler to determine whether args
|
|
||||||
* can still be set.
|
|
||||||
*/
|
|
||||||
virtual bool allowMore();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use by output classes to determine whether an Arg accepts
|
|
||||||
* multiple values.
|
|
||||||
*/
|
|
||||||
virtual bool acceptsMultipleValues();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears the Arg object and allows it to be reused by new
|
|
||||||
* command lines.
|
|
||||||
*/
|
|
||||||
virtual void reset();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Typedef of an Arg list iterator.
|
|
||||||
*/
|
|
||||||
typedef std::list<Arg*>::const_iterator ArgListIterator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Typedef of an Arg vector iterator.
|
|
||||||
*/
|
|
||||||
typedef std::vector<Arg*>::const_iterator ArgVectorIterator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Typedef of a Visitor list iterator.
|
|
||||||
*/
|
|
||||||
typedef std::list<Visitor*>::const_iterator VisitorListIterator;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Extract a value of type T from it's string representation contained
|
|
||||||
* in strVal. The ValueLike parameter used to select the correct
|
|
||||||
* specialization of ExtractValue depending on the value traits of T.
|
|
||||||
* ValueLike traits use operator>> to assign the value from strVal.
|
|
||||||
*/
|
|
||||||
template<typename T> void
|
|
||||||
ExtractValue(T &destVal, const std::string& strVal, ValueLike vl)
|
|
||||||
{
|
|
||||||
static_cast<void>(vl); // Avoid warning about unused vl
|
|
||||||
istringstream is(strVal.c_str());
|
|
||||||
|
|
||||||
int valuesRead = 0;
|
|
||||||
while ( is.good() ) {
|
|
||||||
if ( is.peek() != EOF )
|
|
||||||
#ifdef TCLAP_SETBASE_ZERO
|
|
||||||
is >> std::setbase(0) >> destVal;
|
|
||||||
#else
|
|
||||||
is >> destVal;
|
|
||||||
#endif
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
valuesRead++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( is.fail() )
|
|
||||||
throw( ArgParseException("Couldn't read argument value "
|
|
||||||
"from string '" + strVal + "'"));
|
|
||||||
|
|
||||||
|
|
||||||
if ( valuesRead > 1 )
|
|
||||||
throw( ArgParseException("More than one valid value parsed from "
|
|
||||||
"string '" + strVal + "'"));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Extract a value of type T from it's string representation contained
|
|
||||||
* in strVal. The ValueLike parameter used to select the correct
|
|
||||||
* specialization of ExtractValue depending on the value traits of T.
|
|
||||||
* StringLike uses assignment (operator=) to assign from strVal.
|
|
||||||
*/
|
|
||||||
template<typename T> void
|
|
||||||
ExtractValue(T &destVal, const std::string& strVal, StringLike sl)
|
|
||||||
{
|
|
||||||
static_cast<void>(sl); // Avoid warning about unused sl
|
|
||||||
SetString(destVal, strVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//BEGIN Arg.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
inline Arg::Arg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
bool valreq,
|
|
||||||
Visitor* v) :
|
|
||||||
_flag(flag),
|
|
||||||
_name(name),
|
|
||||||
_description(desc),
|
|
||||||
_required(req),
|
|
||||||
_requireLabel("required"),
|
|
||||||
_valueRequired(valreq),
|
|
||||||
_alreadySet(false),
|
|
||||||
_visitor( v ),
|
|
||||||
_ignoreable(true),
|
|
||||||
_xorSet(false),
|
|
||||||
_acceptsMultipleValues(false)
|
|
||||||
{
|
|
||||||
if ( _flag.length() > 1 )
|
|
||||||
throw(SpecificationException(
|
|
||||||
"Argument flag can only be one character long", toString() ) );
|
|
||||||
|
|
||||||
if ( _name != ignoreNameString() &&
|
|
||||||
( _flag == Arg::flagStartString() ||
|
|
||||||
_flag == Arg::nameStartString() ||
|
|
||||||
_flag == " " ) )
|
|
||||||
throw(SpecificationException("Argument flag cannot be either '" +
|
|
||||||
Arg::flagStartString() + "' or '" +
|
|
||||||
Arg::nameStartString() + "' or a space.",
|
|
||||||
toString() ) );
|
|
||||||
|
|
||||||
if ( ( _name.substr( 0, Arg::flagStartString().length() ) == Arg::flagStartString() ) ||
|
|
||||||
( _name.substr( 0, Arg::nameStartString().length() ) == Arg::nameStartString() ) ||
|
|
||||||
( _name.find( " ", 0 ) != std::string::npos ) )
|
|
||||||
throw(SpecificationException("Argument name begin with either '" +
|
|
||||||
Arg::flagStartString() + "' or '" +
|
|
||||||
Arg::nameStartString() + "' or space.",
|
|
||||||
toString() ) );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Arg::~Arg() { }
|
|
||||||
|
|
||||||
inline std::string Arg::shortID( const std::string& valueId ) const
|
|
||||||
{
|
|
||||||
std::string id = "";
|
|
||||||
|
|
||||||
if ( _flag != "" )
|
|
||||||
id = Arg::flagStartString() + _flag;
|
|
||||||
else
|
|
||||||
id = Arg::nameStartString() + _name;
|
|
||||||
|
|
||||||
if ( _valueRequired )
|
|
||||||
id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">";
|
|
||||||
|
|
||||||
if ( !_required )
|
|
||||||
id = "[" + id + "]";
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string Arg::longID( const std::string& valueId ) const
|
|
||||||
{
|
|
||||||
std::string id = "";
|
|
||||||
|
|
||||||
if ( _flag != "" )
|
|
||||||
{
|
|
||||||
id += Arg::flagStartString() + _flag;
|
|
||||||
|
|
||||||
if ( _valueRequired )
|
|
||||||
id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">";
|
|
||||||
|
|
||||||
id += ", ";
|
|
||||||
}
|
|
||||||
|
|
||||||
id += Arg::nameStartString() + _name;
|
|
||||||
|
|
||||||
if ( _valueRequired )
|
|
||||||
id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">";
|
|
||||||
|
|
||||||
return id;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool Arg::operator==(const Arg& a) const
|
|
||||||
{
|
|
||||||
if ( ( _flag != "" && _flag == a._flag ) || _name == a._name)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string Arg::getDescription() const
|
|
||||||
{
|
|
||||||
std::string desc = "";
|
|
||||||
if ( _required )
|
|
||||||
desc = "(" + _requireLabel + ") ";
|
|
||||||
|
|
||||||
// if ( _valueRequired )
|
|
||||||
// desc += "(value required) ";
|
|
||||||
|
|
||||||
desc += _description;
|
|
||||||
return desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const std::string& Arg::getFlag() const { return _flag; }
|
|
||||||
|
|
||||||
inline const std::string& Arg::getName() const { return _name; }
|
|
||||||
|
|
||||||
inline bool Arg::isRequired() const { return _required; }
|
|
||||||
|
|
||||||
inline bool Arg::isValueRequired() const { return _valueRequired; }
|
|
||||||
|
|
||||||
inline bool Arg::isSet() const
|
|
||||||
{
|
|
||||||
if ( _alreadySet && !_xorSet )
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool Arg::isIgnoreable() const { return _ignoreable; }
|
|
||||||
|
|
||||||
inline void Arg::setRequireLabel( const std::string& s)
|
|
||||||
{
|
|
||||||
_requireLabel = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool Arg::argMatches( const std::string& argFlag ) const
|
|
||||||
{
|
|
||||||
if ( ( argFlag == Arg::flagStartString() + _flag && _flag != "" ) ||
|
|
||||||
argFlag == Arg::nameStartString() + _name )
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string Arg::toString() const
|
|
||||||
{
|
|
||||||
std::string s = "";
|
|
||||||
|
|
||||||
if ( _flag != "" )
|
|
||||||
s += Arg::flagStartString() + _flag + " ";
|
|
||||||
|
|
||||||
s += "(" + Arg::nameStartString() + _name + ")";
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Arg::_checkWithVisitor() const
|
|
||||||
{
|
|
||||||
if ( _visitor != NULL )
|
|
||||||
_visitor->visit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of trimFlag.
|
|
||||||
*/
|
|
||||||
inline void Arg::trimFlag(std::string& flag, std::string& value) const
|
|
||||||
{
|
|
||||||
int stop = 0;
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < flag.length(); i++ )
|
|
||||||
if ( flag[i] == Arg::delimiter() )
|
|
||||||
{
|
|
||||||
stop = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( stop > 1 )
|
|
||||||
{
|
|
||||||
value = flag.substr(stop+1);
|
|
||||||
flag = flag.substr(0,stop);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of _hasBlanks.
|
|
||||||
*/
|
|
||||||
inline bool Arg::_hasBlanks( const std::string& s ) const
|
|
||||||
{
|
|
||||||
for ( int i = 1; static_cast<unsigned int>(i) < s.length(); i++ )
|
|
||||||
if ( s[i] == Arg::blankChar() )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Arg::forceRequired()
|
|
||||||
{
|
|
||||||
_required = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Arg::xorSet()
|
|
||||||
{
|
|
||||||
_alreadySet = true;
|
|
||||||
_xorSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overridden by Args that need to added to the end of the list.
|
|
||||||
*/
|
|
||||||
inline void Arg::addToList( std::list<Arg*>& argList ) const
|
|
||||||
{
|
|
||||||
argList.push_front( const_cast<Arg*>(this) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool Arg::allowMore()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool Arg::acceptsMultipleValues()
|
|
||||||
{
|
|
||||||
return _acceptsMultipleValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Arg::reset()
|
|
||||||
{
|
|
||||||
_xorSet = false;
|
|
||||||
_alreadySet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//END Arg.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,213 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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_ARG_EXCEPTION_H
|
|
||||||
#define TCLAP_ARG_EXCEPTION_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple class that defines and argument exception. Should be caught
|
|
||||||
* whenever a CmdLine is created and parsed.
|
|
||||||
*/
|
|
||||||
class ArgException : public std::exception
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param text - The text of the exception.
|
|
||||||
* \param id - The text identifying the argument source.
|
|
||||||
* \param td - Text describing the type of ArgException it is.
|
|
||||||
* of the exception.
|
|
||||||
*/
|
|
||||||
ArgException( const std::string& text = "undefined exception",
|
|
||||||
const std::string& id = "undefined",
|
|
||||||
const std::string& td = "Generic ArgException")
|
|
||||||
: std::exception(),
|
|
||||||
_errorText(text),
|
|
||||||
_argId( id ),
|
|
||||||
_typeDescription(td)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor.
|
|
||||||
*/
|
|
||||||
virtual ~ArgException() throw() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the error text.
|
|
||||||
*/
|
|
||||||
std::string error() const { return ( _errorText ); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the argument id.
|
|
||||||
*/
|
|
||||||
std::string argId() const
|
|
||||||
{
|
|
||||||
if ( _argId == "undefined" )
|
|
||||||
return " ";
|
|
||||||
else
|
|
||||||
return ( "Argument: " + _argId );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the arg id and error text.
|
|
||||||
*/
|
|
||||||
const char* what() const throw()
|
|
||||||
{
|
|
||||||
static std::string ex;
|
|
||||||
ex = _argId + " -- " + _errorText;
|
|
||||||
return ex.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the type of the exception. Used to explain and distinguish
|
|
||||||
* between different child exceptions.
|
|
||||||
*/
|
|
||||||
std::string typeDescription() const
|
|
||||||
{
|
|
||||||
return _typeDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The text of the exception message.
|
|
||||||
*/
|
|
||||||
std::string _errorText;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The argument related to this exception.
|
|
||||||
*/
|
|
||||||
std::string _argId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Describes the type of the exception. Used to distinguish
|
|
||||||
* between different child exceptions.
|
|
||||||
*/
|
|
||||||
std::string _typeDescription;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Thrown from within the child Arg classes when it fails to properly
|
|
||||||
* parse the argument it has been passed.
|
|
||||||
*/
|
|
||||||
class ArgParseException : public ArgException
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param text - The text of the exception.
|
|
||||||
* \param id - The text identifying the argument source
|
|
||||||
* of the exception.
|
|
||||||
*/
|
|
||||||
ArgParseException( const std::string& text = "undefined exception",
|
|
||||||
const std::string& id = "undefined" )
|
|
||||||
: ArgException( text,
|
|
||||||
id,
|
|
||||||
std::string( "Exception found while parsing " ) +
|
|
||||||
std::string( "the value the Arg has been passed." ))
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Thrown from CmdLine when the arguments on the command line are not
|
|
||||||
* properly specified, e.g. too many arguments, required argument missing, etc.
|
|
||||||
*/
|
|
||||||
class CmdLineParseException : public ArgException
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param text - The text of the exception.
|
|
||||||
* \param id - The text identifying the argument source
|
|
||||||
* of the exception.
|
|
||||||
*/
|
|
||||||
CmdLineParseException( const std::string& text = "undefined exception",
|
|
||||||
const std::string& id = "undefined" )
|
|
||||||
: ArgException( text,
|
|
||||||
id,
|
|
||||||
std::string( "Exception found when the values ") +
|
|
||||||
std::string( "on the command line do not meet ") +
|
|
||||||
std::string( "the requirements of the defined ") +
|
|
||||||
std::string( "Args." ))
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.
|
|
||||||
* same flag as another Arg, same name, etc.
|
|
||||||
*/
|
|
||||||
class SpecificationException : public ArgException
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param text - The text of the exception.
|
|
||||||
* \param id - The text identifying the argument source
|
|
||||||
* of the exception.
|
|
||||||
*/
|
|
||||||
SpecificationException( const std::string& text = "undefined exception",
|
|
||||||
const std::string& id = "undefined" )
|
|
||||||
: ArgException( text,
|
|
||||||
id,
|
|
||||||
std::string("Exception found when an Arg object ")+
|
|
||||||
std::string("is improperly defined by the ") +
|
|
||||||
std::string("developer." ))
|
|
||||||
{ }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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) {}
|
|
||||||
|
|
||||||
int getExitStatus() const { return _estat; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
int _estat;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// This is an internal tclap file, you should probably not have to
|
|
||||||
// include this directly
|
|
||||||
|
|
||||||
#ifndef TCLAP_ARGTRAITS_H
|
|
||||||
#define TCLAP_ARGTRAITS_H
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
// We use two empty structs to get compile type specialization
|
|
||||||
// function to work
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A value like argument value type is a value that can be set using
|
|
||||||
* operator>>. This is the default value type.
|
|
||||||
*/
|
|
||||||
struct ValueLike {
|
|
||||||
typedef ValueLike ValueCategory;
|
|
||||||
virtual ~ValueLike() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A string like argument value type is a value that can be set using
|
|
||||||
* operator=(string). Useful if the value type contains spaces which
|
|
||||||
* will be broken up into individual tokens by operator>>.
|
|
||||||
*/
|
|
||||||
struct StringLike {
|
|
||||||
virtual ~StringLike() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A class can inherit from this object to make it have string like
|
|
||||||
* traits. This is a compile time thing and does not add any overhead
|
|
||||||
* to the inherenting class.
|
|
||||||
*/
|
|
||||||
struct StringLikeTrait {
|
|
||||||
typedef StringLike ValueCategory;
|
|
||||||
virtual ~StringLikeTrait() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A class can inherit from this object to make it have value like
|
|
||||||
* traits. This is a compile time thing and does not add any overhead
|
|
||||||
* to the inherenting class.
|
|
||||||
*/
|
|
||||||
struct ValueLikeTrait {
|
|
||||||
typedef ValueLike ValueCategory;
|
|
||||||
virtual ~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. ValueLike is the
|
|
||||||
* default and means that operator>> will be used to assign values to
|
|
||||||
* the type.
|
|
||||||
*/
|
|
||||||
template<typename T>
|
|
||||||
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
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,657 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: CmdLine.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
|
|
||||||
* 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,
|
|
||||||
* 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_CMDLINE_H
|
|
||||||
#define TCLAP_CMDLINE_H
|
|
||||||
|
|
||||||
#include <tclap/SwitchArg.h>
|
|
||||||
#include <tclap/MultiSwitchArg.h>
|
|
||||||
#include <tclap/UnlabeledValueArg.h>
|
|
||||||
#include <tclap/UnlabeledMultiArg.h>
|
|
||||||
|
|
||||||
#include <tclap/XorHandler.h>
|
|
||||||
#include <tclap/HelpVisitor.h>
|
|
||||||
#include <tclap/VersionVisitor.h>
|
|
||||||
#include <tclap/IgnoreRestVisitor.h>
|
|
||||||
|
|
||||||
#include <tclap/CmdLineOutput.h>
|
|
||||||
#include <tclap/StdOutput.h>
|
|
||||||
|
|
||||||
#include <tclap/Constraint.h>
|
|
||||||
#include <tclap/ValuesConstraint.h>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <stdlib.h> // Needed for exit(), which isn't defined in some envs.
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
template<typename T> void DelPtr(T ptr)
|
|
||||||
{
|
|
||||||
delete ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename C> void ClearContainer(C &c)
|
|
||||||
{
|
|
||||||
typedef typename C::value_type value_type;
|
|
||||||
std::for_each(c.begin(), c.end(), DelPtr<value_type>);
|
|
||||||
c.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The base class that manages the command line definition and passes
|
|
||||||
* along the parsing to the appropriate Arg classes.
|
|
||||||
*/
|
|
||||||
class CmdLine : public CmdLineInterface
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The list of arguments that will be tested against the
|
|
||||||
* command line.
|
|
||||||
*/
|
|
||||||
std::list<Arg*> _argList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The name of the program. Set to argv[0].
|
|
||||||
*/
|
|
||||||
std::string _progName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A message used to describe the program. Used in the usage output.
|
|
||||||
*/
|
|
||||||
std::string _message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The version to be displayed with the --version switch.
|
|
||||||
*/
|
|
||||||
std::string _version;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number of arguments that are required to be present on
|
|
||||||
* the command line. This is set dynamically, based on the
|
|
||||||
* Args added to the CmdLine object.
|
|
||||||
*/
|
|
||||||
int _numRequired;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The character that is used to separate the argument flag/name
|
|
||||||
* from the value. Defaults to ' ' (space).
|
|
||||||
*/
|
|
||||||
char _delimiter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The handler that manages xoring lists of args.
|
|
||||||
*/
|
|
||||||
XorHandler _xorHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of Args to be explicitly deleted when the destructor
|
|
||||||
* is called. At the moment, this only includes the three default
|
|
||||||
* Args.
|
|
||||||
*/
|
|
||||||
std::list<Arg*> _argDeleteOnExitList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of Visitors to be explicitly deleted when the destructor
|
|
||||||
* is called. At the moment, these are the Visitors created for the
|
|
||||||
* default Args.
|
|
||||||
*/
|
|
||||||
std::list<Visitor*> _visitorDeleteOnExitList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Object that handles all output for the CmdLine.
|
|
||||||
*/
|
|
||||||
CmdLineOutput* _output;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Should CmdLine handle parsing exceptions internally?
|
|
||||||
*/
|
|
||||||
bool _handleExceptions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Throws an exception listing the missing args.
|
|
||||||
*/
|
|
||||||
void missingArgsException();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether a name/flag string matches entirely matches
|
|
||||||
* the Arg::blankChar. Used when multiple switches are combined
|
|
||||||
* into a single argument.
|
|
||||||
* \param s - The message to be used in the usage.
|
|
||||||
*/
|
|
||||||
bool _emptyCombined(const std::string& s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform a delete ptr; operation on ptr when this object is deleted.
|
|
||||||
*/
|
|
||||||
void deleteOnExit(Arg* ptr);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform a delete ptr; operation on ptr when this object is deleted.
|
|
||||||
*/
|
|
||||||
void deleteOnExit(Visitor* ptr);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying.
|
|
||||||
*/
|
|
||||||
CmdLine(const CmdLine& rhs);
|
|
||||||
CmdLine& operator=(const CmdLine& rhs);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encapsulates the code common to the constructors
|
|
||||||
* (which is all of it).
|
|
||||||
*/
|
|
||||||
void _constructor();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is set to true when a user sets the output object. We use this so
|
|
||||||
* that we don't delete objects that are created outside of this lib.
|
|
||||||
*/
|
|
||||||
bool _userSetOutput;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not to automatically create help and version switches.
|
|
||||||
*/
|
|
||||||
bool _helpAndVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not to ignore unmatched args.
|
|
||||||
*/
|
|
||||||
bool _ignoreUnmatched;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Command line constructor. Defines how the arguments will be
|
|
||||||
* parsed.
|
|
||||||
* \param message - The message to be used in the usage
|
|
||||||
* output.
|
|
||||||
* \param delimiter - The character that is used to separate
|
|
||||||
* the argument flag/name from the value. Defaults to ' ' (space).
|
|
||||||
* \param version - The version number to be used in the
|
|
||||||
* --version switch.
|
|
||||||
* \param helpAndVersion - Whether or not to create the Help and
|
|
||||||
* Version switches. Defaults to true.
|
|
||||||
*/
|
|
||||||
CmdLine(const std::string& message,
|
|
||||||
const char delimiter = ' ',
|
|
||||||
const std::string& version = "none",
|
|
||||||
bool helpAndVersion = true);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes any resources allocated by a CmdLine object.
|
|
||||||
*/
|
|
||||||
virtual ~CmdLine();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds an argument to the list of arguments to be parsed.
|
|
||||||
* \param a - Argument to be added.
|
|
||||||
*/
|
|
||||||
void add( Arg& a );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An alternative add. Functionally identical.
|
|
||||||
* \param a - Argument to be added.
|
|
||||||
*/
|
|
||||||
void add( Arg* a );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add two Args that will be xor'd. If this method is used, add does
|
|
||||||
* not need to be called.
|
|
||||||
* \param a - Argument to be added and xor'd.
|
|
||||||
* \param b - Argument to be added and xor'd.
|
|
||||||
*/
|
|
||||||
void xorAdd( Arg& a, Arg& b );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a list of Args that will be xor'd. If this method is used,
|
|
||||||
* add does not need to be called.
|
|
||||||
* \param xors - List of Args to be added and xor'd.
|
|
||||||
*/
|
|
||||||
void xorAdd( const std::vector<Arg*>& xors );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses the command line.
|
|
||||||
* \param argc - Number of arguments.
|
|
||||||
* \param argv - Array of arguments.
|
|
||||||
*/
|
|
||||||
void parse(int argc, const char * const * argv);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses the command line.
|
|
||||||
* \param args - A vector of strings representing the args.
|
|
||||||
* args[0] is still the program name.
|
|
||||||
*/
|
|
||||||
void parse(std::vector<std::string>& args);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
CmdLineOutput* getOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void setOutput(CmdLineOutput* co);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
std::string& getVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
std::string& getProgramName();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
std::list<Arg*>& getArgList();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
XorHandler& getXorHandler();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
char getDelimiter();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
std::string& getMessage();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
bool hasHelpAndVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Disables or enables CmdLine's internal parsing exception handling.
|
|
||||||
*
|
|
||||||
* @param state Should CmdLine handle parsing exceptions internally?
|
|
||||||
*/
|
|
||||||
void setExceptionHandling(const bool state);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the current state of the internal exception handling.
|
|
||||||
*
|
|
||||||
* @retval true Parsing exceptions are handled internally.
|
|
||||||
* @retval false Parsing exceptions are propagated to the caller.
|
|
||||||
*/
|
|
||||||
bool getExceptionHandling() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows the CmdLine object to be reused.
|
|
||||||
*/
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
//Begin CmdLine.cpp
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
inline CmdLine::CmdLine(const std::string& m,
|
|
||||||
char delim,
|
|
||||||
const std::string& v,
|
|
||||||
bool help )
|
|
||||||
:
|
|
||||||
_argList(std::list<Arg*>()),
|
|
||||||
_progName("not_set_yet"),
|
|
||||||
_message(m),
|
|
||||||
_version(v),
|
|
||||||
_numRequired(0),
|
|
||||||
_delimiter(delim),
|
|
||||||
_xorHandler(XorHandler()),
|
|
||||||
_argDeleteOnExitList(std::list<Arg*>()),
|
|
||||||
_visitorDeleteOnExitList(std::list<Visitor*>()),
|
|
||||||
_output(0),
|
|
||||||
_handleExceptions(true),
|
|
||||||
_userSetOutput(false),
|
|
||||||
_helpAndVersion(help),
|
|
||||||
_ignoreUnmatched(false)
|
|
||||||
{
|
|
||||||
_constructor();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline CmdLine::~CmdLine()
|
|
||||||
{
|
|
||||||
ClearContainer(_argDeleteOnExitList);
|
|
||||||
ClearContainer(_visitorDeleteOnExitList);
|
|
||||||
|
|
||||||
if ( !_userSetOutput ) {
|
|
||||||
delete _output;
|
|
||||||
_output = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::_constructor()
|
|
||||||
{
|
|
||||||
_output = new StdOutput;
|
|
||||||
|
|
||||||
Arg::setDelimiter( _delimiter );
|
|
||||||
|
|
||||||
Visitor* v;
|
|
||||||
|
|
||||||
if ( _helpAndVersion )
|
|
||||||
{
|
|
||||||
v = new HelpVisitor( this, &_output );
|
|
||||||
SwitchArg* help = new SwitchArg("h","help",
|
|
||||||
"Displays usage information and exits.",
|
|
||||||
false, v);
|
|
||||||
add( help );
|
|
||||||
deleteOnExit(help);
|
|
||||||
deleteOnExit(v);
|
|
||||||
|
|
||||||
v = new VersionVisitor( this, &_output );
|
|
||||||
SwitchArg* vers = new SwitchArg("","version",
|
|
||||||
"Displays version information and exits.",
|
|
||||||
false, v);
|
|
||||||
add( vers );
|
|
||||||
deleteOnExit(vers);
|
|
||||||
deleteOnExit(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
v = new IgnoreRestVisitor();
|
|
||||||
SwitchArg* ignore = new SwitchArg(Arg::flagStartString(),
|
|
||||||
Arg::ignoreNameString(),
|
|
||||||
"Ignores the rest of the labeled arguments following this flag.",
|
|
||||||
false, v);
|
|
||||||
add( ignore );
|
|
||||||
deleteOnExit(ignore);
|
|
||||||
deleteOnExit(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::xorAdd( const std::vector<Arg*>& ors )
|
|
||||||
{
|
|
||||||
_xorHandler.add( ors );
|
|
||||||
|
|
||||||
for (ArgVectorIterator it = ors.begin(); it != ors.end(); it++)
|
|
||||||
{
|
|
||||||
(*it)->forceRequired();
|
|
||||||
(*it)->setRequireLabel( "OR required" );
|
|
||||||
add( *it );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::xorAdd( Arg& a, Arg& b )
|
|
||||||
{
|
|
||||||
std::vector<Arg*> ors;
|
|
||||||
ors.push_back( &a );
|
|
||||||
ors.push_back( &b );
|
|
||||||
xorAdd( ors );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::add( Arg& a )
|
|
||||||
{
|
|
||||||
add( &a );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::add( Arg* a )
|
|
||||||
{
|
|
||||||
for( ArgListIterator it = _argList.begin(); it != _argList.end(); it++ )
|
|
||||||
if ( *a == *(*it) )
|
|
||||||
throw( SpecificationException(
|
|
||||||
"Argument with same flag/name already exists!",
|
|
||||||
a->longID() ) );
|
|
||||||
|
|
||||||
a->addToList( _argList );
|
|
||||||
|
|
||||||
if ( a->isRequired() )
|
|
||||||
_numRequired++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void CmdLine::parse(int argc, const char * const * argv)
|
|
||||||
{
|
|
||||||
// this step is necessary so that we have easy access to
|
|
||||||
// mutable strings.
|
|
||||||
std::vector<std::string> args;
|
|
||||||
for (int i = 0; i < argc; i++)
|
|
||||||
args.push_back(argv[i]);
|
|
||||||
|
|
||||||
parse(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
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());
|
|
||||||
|
|
||||||
int requiredCount = 0;
|
|
||||||
|
|
||||||
for (int i = 0; static_cast<unsigned int>(i) < args.size(); i++)
|
|
||||||
{
|
|
||||||
bool matched = false;
|
|
||||||
for (ArgListIterator it = _argList.begin();
|
|
||||||
it != _argList.end(); it++) {
|
|
||||||
if ( (*it)->processArg( &i, args ) )
|
|
||||||
{
|
|
||||||
requiredCount += _xorHandler.check( *it );
|
|
||||||
matched = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// checks to see if the argument is an empty combined
|
|
||||||
// switch and if so, then we've actually matched it
|
|
||||||
if ( !matched && _emptyCombined( args[i] ) )
|
|
||||||
matched = true;
|
|
||||||
|
|
||||||
if ( !matched && !Arg::ignoreRest() && !_ignoreUnmatched)
|
|
||||||
throw(CmdLineParseException("Couldn't find match "
|
|
||||||
"for argument",
|
|
||||||
args[i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( requiredCount < _numRequired )
|
|
||||||
missingArgsException();
|
|
||||||
|
|
||||||
if ( requiredCount > _numRequired )
|
|
||||||
throw(CmdLineParseException("Too many arguments!"));
|
|
||||||
|
|
||||||
} catch ( ArgException& e ) {
|
|
||||||
// If we're not handling the exceptions, rethrow.
|
|
||||||
if ( !_handleExceptions) {
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
_output->failure(*this,e);
|
|
||||||
} catch ( ExitException &ee ) {
|
|
||||||
estat = ee.getExitStatus();
|
|
||||||
shouldExit = true;
|
|
||||||
}
|
|
||||||
} catch (ExitException &ee) {
|
|
||||||
// If we're not handling the exceptions, rethrow.
|
|
||||||
if ( !_handleExceptions) {
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
estat = ee.getExitStatus();
|
|
||||||
shouldExit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldExit)
|
|
||||||
exit(estat);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool CmdLine::_emptyCombined(const std::string& s)
|
|
||||||
{
|
|
||||||
if ( s.length() > 0 && s[0] != Arg::flagStartChar() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for ( int i = 1; static_cast<unsigned int>(i) < s.length(); i++ )
|
|
||||||
if ( s[i] != Arg::blankChar() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::missingArgsException()
|
|
||||||
{
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
std::string missingArgList;
|
|
||||||
for (ArgListIterator it = _argList.begin(); it != _argList.end(); it++)
|
|
||||||
{
|
|
||||||
if ( (*it)->isRequired() && !(*it)->isSet() )
|
|
||||||
{
|
|
||||||
missingArgList += (*it)->getName();
|
|
||||||
missingArgList += ", ";
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
missingArgList = missingArgList.substr(0,missingArgList.length()-2);
|
|
||||||
|
|
||||||
std::string msg;
|
|
||||||
if ( count > 1 )
|
|
||||||
msg = "Required arguments missing: ";
|
|
||||||
else
|
|
||||||
msg = "Required argument missing: ";
|
|
||||||
|
|
||||||
msg += missingArgList;
|
|
||||||
|
|
||||||
throw(CmdLineParseException(msg));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::deleteOnExit(Arg* ptr)
|
|
||||||
{
|
|
||||||
_argDeleteOnExitList.push_back(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::deleteOnExit(Visitor* ptr)
|
|
||||||
{
|
|
||||||
_visitorDeleteOnExitList.push_back(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline CmdLineOutput* CmdLine::getOutput()
|
|
||||||
{
|
|
||||||
return _output;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::setOutput(CmdLineOutput* co)
|
|
||||||
{
|
|
||||||
if ( !_userSetOutput )
|
|
||||||
delete _output;
|
|
||||||
_userSetOutput = true;
|
|
||||||
_output = co;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string& CmdLine::getVersion()
|
|
||||||
{
|
|
||||||
return _version;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string& CmdLine::getProgramName()
|
|
||||||
{
|
|
||||||
return _progName;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::list<Arg*>& CmdLine::getArgList()
|
|
||||||
{
|
|
||||||
return _argList;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline XorHandler& CmdLine::getXorHandler()
|
|
||||||
{
|
|
||||||
return _xorHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline char CmdLine::getDelimiter()
|
|
||||||
{
|
|
||||||
return _delimiter;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string& CmdLine::getMessage()
|
|
||||||
{
|
|
||||||
return _message;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool CmdLine::hasHelpAndVersion()
|
|
||||||
{
|
|
||||||
return _helpAndVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::setExceptionHandling(const bool state)
|
|
||||||
{
|
|
||||||
_handleExceptions = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool CmdLine::getExceptionHandling() const
|
|
||||||
{
|
|
||||||
return _handleExceptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::reset()
|
|
||||||
{
|
|
||||||
for( ArgListIterator it = _argList.begin(); it != _argList.end(); it++ )
|
|
||||||
(*it)->reset();
|
|
||||||
|
|
||||||
_progName.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void CmdLine::ignoreUnmatched(const bool ignore)
|
|
||||||
{
|
|
||||||
_ignoreUnmatched = ignore;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
//End CmdLine.cpp
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
#endif
|
|
@ -1,153 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: CmdLineInterface.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,
|
|
||||||
* 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_COMMANDLINE_INTERFACE_H
|
|
||||||
#define TCLAP_COMMANDLINE_INTERFACE_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
class Arg;
|
|
||||||
class CmdLineOutput;
|
|
||||||
class XorHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The base class that manages the command line definition and passes
|
|
||||||
* along the parsing to the appropriate Arg classes.
|
|
||||||
*/
|
|
||||||
class CmdLineInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
virtual ~CmdLineInterface() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds an argument to the list of arguments to be parsed.
|
|
||||||
* \param a - Argument to be added.
|
|
||||||
*/
|
|
||||||
virtual void add( Arg& a )=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An alternative add. Functionally identical.
|
|
||||||
* \param a - Argument to be added.
|
|
||||||
*/
|
|
||||||
virtual void add( Arg* a )=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add two Args that will be xor'd.
|
|
||||||
* If this method is used, add does
|
|
||||||
* not need to be called.
|
|
||||||
* \param a - Argument to be added and xor'd.
|
|
||||||
* \param b - Argument to be added and xor'd.
|
|
||||||
*/
|
|
||||||
virtual void xorAdd( Arg& a, Arg& b )=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a list of Args that will be xor'd. If this method is used,
|
|
||||||
* add does not need to be called.
|
|
||||||
* \param xors - List of Args to be added and xor'd.
|
|
||||||
*/
|
|
||||||
virtual void xorAdd( const std::vector<Arg*>& xors )=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses the command line.
|
|
||||||
* \param argc - Number of arguments.
|
|
||||||
* \param argv - Array of arguments.
|
|
||||||
*/
|
|
||||||
virtual void parse(int argc, const char * const * argv)=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses the command line.
|
|
||||||
* \param args - A vector of strings representing the args.
|
|
||||||
* args[0] is still the program name.
|
|
||||||
*/
|
|
||||||
void parse(std::vector<std::string>& args);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the CmdLineOutput object.
|
|
||||||
*/
|
|
||||||
virtual CmdLineOutput* getOutput()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \param co - CmdLineOutput object that we want to use instead.
|
|
||||||
*/
|
|
||||||
virtual void setOutput(CmdLineOutput* co)=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the version string.
|
|
||||||
*/
|
|
||||||
virtual std::string& getVersion()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the program name string.
|
|
||||||
*/
|
|
||||||
virtual std::string& getProgramName()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the argList.
|
|
||||||
*/
|
|
||||||
virtual std::list<Arg*>& getArgList()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the XorHandler.
|
|
||||||
*/
|
|
||||||
virtual XorHandler& getXorHandler()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the delimiter string.
|
|
||||||
*/
|
|
||||||
virtual char getDelimiter()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the message string.
|
|
||||||
*/
|
|
||||||
virtual std::string& getMessage()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether or not the help and version switches were created
|
|
||||||
* automatically.
|
|
||||||
*/
|
|
||||||
virtual bool hasHelpAndVersion()=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets the instance as if it had just been constructed so that the
|
|
||||||
* instance can be reused.
|
|
||||||
*/
|
|
||||||
virtual void reset()=0;
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,77 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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_CMDLINEOUTPUT_H
|
|
||||||
#define TCLAP_CMDLINEOUTPUT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
class CmdLineInterface;
|
|
||||||
class ArgException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The interface that any output object must implement.
|
|
||||||
*/
|
|
||||||
class CmdLineOutput
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Virtual destructor.
|
|
||||||
*/
|
|
||||||
virtual ~CmdLineOutput() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates some sort of output for the USAGE.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void usage(CmdLineInterface& c)=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates some sort of output for the version.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void version(CmdLineInterface& c)=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates some sort of output for a failure.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
* \param e - The ArgException that caused the failure.
|
|
||||||
*/
|
|
||||||
virtual void failure( CmdLineInterface& c,
|
|
||||||
ArgException& e )=0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
#endif
|
|
@ -1,78 +0,0 @@
|
|||||||
// -*- 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
|
|
||||||
* 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,
|
|
||||||
* 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_CONSTRAINT_H
|
|
||||||
#define TCLAP_CONSTRAINT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The interface that defines the interaction between the Arg and Constraint.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
class Constraint
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Returns a description of the Constraint.
|
|
||||||
*/
|
|
||||||
virtual std::string description() const =0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the short ID for the Constraint.
|
|
||||||
*/
|
|
||||||
virtual std::string shortID() const =0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The method used to verify that the value parsed from the command
|
|
||||||
* line meets the constraint.
|
|
||||||
* \param value - The value that will be checked.
|
|
||||||
*/
|
|
||||||
virtual bool check(const T& value) const =0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor.
|
|
||||||
* Silences warnings about Constraint being a base class with virtual
|
|
||||||
* 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
|
|
||||||
#endif
|
|
@ -1,303 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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_DOCBOOKOUTPUT_H
|
|
||||||
#define TCLAP_DOCBOOKOUTPUT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <tclap/CmdLineInterface.h>
|
|
||||||
#include <tclap/CmdLineOutput.h>
|
|
||||||
#include <tclap/XorHandler.h>
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A class that generates DocBook output for usage() method for the
|
|
||||||
* given CmdLine and its Args.
|
|
||||||
*/
|
|
||||||
class DocBookOutput : public CmdLineOutput
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the usage to stdout. Can be overridden to
|
|
||||||
* produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void usage(CmdLineInterface& c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the version to stdout. Can be overridden
|
|
||||||
* to produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void version(CmdLineInterface& c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints (to stderr) an error message, short usage
|
|
||||||
* Can be overridden to produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
* \param e - The ArgException that caused the failure.
|
|
||||||
*/
|
|
||||||
virtual void failure(CmdLineInterface& c,
|
|
||||||
ArgException& e );
|
|
||||||
|
|
||||||
DocBookOutput() : theDelimiter('=') {}
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Substitutes the char r for string x in string s.
|
|
||||||
* \param s - The string to operate on.
|
|
||||||
* \param r - The char to replace.
|
|
||||||
* \param x - What to replace r with.
|
|
||||||
*/
|
|
||||||
void substituteSpecialChars( std::string& s, char r, std::string& x );
|
|
||||||
void removeChar( std::string& s, char r);
|
|
||||||
void basename( std::string& s );
|
|
||||||
|
|
||||||
void printShortArg(Arg* it);
|
|
||||||
void printLongArg(Arg* it);
|
|
||||||
|
|
||||||
char theDelimiter;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
inline void DocBookOutput::version(CmdLineInterface& _cmd)
|
|
||||||
{
|
|
||||||
std::cout << _cmd.getVersion() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::usage(CmdLineInterface& _cmd )
|
|
||||||
{
|
|
||||||
std::list<Arg*> argList = _cmd.getArgList();
|
|
||||||
std::string progName = _cmd.getProgramName();
|
|
||||||
std::string xversion = _cmd.getVersion();
|
|
||||||
theDelimiter = _cmd.getDelimiter();
|
|
||||||
XorHandler xorHandler = _cmd.getXorHandler();
|
|
||||||
const std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
|
|
||||||
basename(progName);
|
|
||||||
|
|
||||||
std::cout << "<?xml version='1.0'?>" << std::endl;
|
|
||||||
std::cout << "<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\"" << std::endl;
|
|
||||||
std::cout << "\t\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\">" << std::endl << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refentry>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refmeta>" << std::endl;
|
|
||||||
std::cout << "<refentrytitle>" << progName << "</refentrytitle>" << std::endl;
|
|
||||||
std::cout << "<manvolnum>1</manvolnum>" << std::endl;
|
|
||||||
std::cout << "</refmeta>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refnamediv>" << std::endl;
|
|
||||||
std::cout << "<refname>" << progName << "</refname>" << std::endl;
|
|
||||||
std::cout << "<refpurpose>" << _cmd.getMessage() << "</refpurpose>" << std::endl;
|
|
||||||
std::cout << "</refnamediv>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refsynopsisdiv>" << std::endl;
|
|
||||||
std::cout << "<cmdsynopsis>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<command>" << progName << "</command>" << std::endl;
|
|
||||||
|
|
||||||
// xor
|
|
||||||
for ( int i = 0; (unsigned int)i < xorList.size(); i++ )
|
|
||||||
{
|
|
||||||
std::cout << "<group choice='req'>" << std::endl;
|
|
||||||
for ( ArgVectorIterator it = xorList[i].begin();
|
|
||||||
it != xorList[i].end(); it++ )
|
|
||||||
printShortArg((*it));
|
|
||||||
|
|
||||||
std::cout << "</group>" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// rest of args
|
|
||||||
for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
|
|
||||||
if ( !xorHandler.contains( (*it) ) )
|
|
||||||
printShortArg((*it));
|
|
||||||
|
|
||||||
std::cout << "</cmdsynopsis>" << std::endl;
|
|
||||||
std::cout << "</refsynopsisdiv>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refsect1>" << std::endl;
|
|
||||||
std::cout << "<title>Description</title>" << std::endl;
|
|
||||||
std::cout << "<para>" << std::endl;
|
|
||||||
std::cout << _cmd.getMessage() << std::endl;
|
|
||||||
std::cout << "</para>" << std::endl;
|
|
||||||
std::cout << "</refsect1>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refsect1>" << std::endl;
|
|
||||||
std::cout << "<title>Options</title>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<variablelist>" << std::endl;
|
|
||||||
|
|
||||||
for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
|
|
||||||
printLongArg((*it));
|
|
||||||
|
|
||||||
std::cout << "</variablelist>" << std::endl;
|
|
||||||
std::cout << "</refsect1>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<refsect1>" << std::endl;
|
|
||||||
std::cout << "<title>Version</title>" << std::endl;
|
|
||||||
std::cout << "<para>" << std::endl;
|
|
||||||
std::cout << xversion << std::endl;
|
|
||||||
std::cout << "</para>" << std::endl;
|
|
||||||
std::cout << "</refsect1>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "</refentry>" << std::endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::failure( CmdLineInterface& _cmd,
|
|
||||||
ArgException& e )
|
|
||||||
{
|
|
||||||
static_cast<void>(_cmd); // unused
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
throw ExitException(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::substituteSpecialChars( std::string& s,
|
|
||||||
char r,
|
|
||||||
std::string& x )
|
|
||||||
{
|
|
||||||
size_t p;
|
|
||||||
while ( (p = s.find_first_of(r)) != std::string::npos )
|
|
||||||
{
|
|
||||||
s.erase(p,1);
|
|
||||||
s.insert(p,x);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::removeChar( std::string& s, char r)
|
|
||||||
{
|
|
||||||
size_t p;
|
|
||||||
while ( (p = s.find_first_of(r)) != std::string::npos )
|
|
||||||
{
|
|
||||||
s.erase(p,1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::basename( std::string& s )
|
|
||||||
{
|
|
||||||
size_t p = s.find_last_of('/');
|
|
||||||
if ( p != std::string::npos )
|
|
||||||
{
|
|
||||||
s.erase(0, p + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::printShortArg(Arg* a)
|
|
||||||
{
|
|
||||||
std::string lt = "<";
|
|
||||||
std::string gt = ">";
|
|
||||||
|
|
||||||
std::string id = a->shortID();
|
|
||||||
substituteSpecialChars(id,'<',lt);
|
|
||||||
substituteSpecialChars(id,'>',gt);
|
|
||||||
removeChar(id,'[');
|
|
||||||
removeChar(id,']');
|
|
||||||
|
|
||||||
std::string choice = "opt";
|
|
||||||
if ( a->isRequired() )
|
|
||||||
choice = "plain";
|
|
||||||
|
|
||||||
std::cout << "<arg choice='" << choice << '\'';
|
|
||||||
if ( a->acceptsMultipleValues() )
|
|
||||||
std::cout << " rep='repeat'";
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << '>';
|
|
||||||
if ( !a->getFlag().empty() )
|
|
||||||
std::cout << a->flagStartChar() << a->getFlag();
|
|
||||||
else
|
|
||||||
std::cout << a->nameStartString() << a->getName();
|
|
||||||
if ( a->isValueRequired() )
|
|
||||||
{
|
|
||||||
std::string arg = a->shortID();
|
|
||||||
removeChar(arg,'[');
|
|
||||||
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>";
|
|
||||||
}
|
|
||||||
std::cout << "</arg>" << std::endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DocBookOutput::printLongArg(Arg* a)
|
|
||||||
{
|
|
||||||
std::string lt = "<";
|
|
||||||
std::string gt = ">";
|
|
||||||
|
|
||||||
std::string desc = a->getDescription();
|
|
||||||
substituteSpecialChars(desc,'<',lt);
|
|
||||||
substituteSpecialChars(desc,'>',gt);
|
|
||||||
|
|
||||||
std::cout << "<varlistentry>" << std::endl;
|
|
||||||
|
|
||||||
if ( !a->getFlag().empty() )
|
|
||||||
{
|
|
||||||
std::cout << "<term>" << std::endl;
|
|
||||||
std::cout << "<option>";
|
|
||||||
std::cout << a->flagStartChar() << a->getFlag();
|
|
||||||
std::cout << "</option>" << std::endl;
|
|
||||||
std::cout << "</term>" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "<term>" << std::endl;
|
|
||||||
std::cout << "<option>";
|
|
||||||
std::cout << a->nameStartString() << a->getName();
|
|
||||||
if ( a->isValueRequired() )
|
|
||||||
{
|
|
||||||
std::string arg = a->shortID();
|
|
||||||
removeChar(arg,'[');
|
|
||||||
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>";
|
|
||||||
}
|
|
||||||
std::cout << "</option>" << std::endl;
|
|
||||||
std::cout << "</term>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "<listitem>" << std::endl;
|
|
||||||
std::cout << "<para>" << std::endl;
|
|
||||||
std::cout << desc << std::endl;
|
|
||||||
std::cout << "</para>" << std::endl;
|
|
||||||
std::cout << "</listitem>" << std::endl;
|
|
||||||
|
|
||||||
std::cout << "</varlistentry>" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
#endif
|
|
@ -1,78 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: HelpVisitor.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* 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,
|
|
||||||
* 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_HELP_VISITOR_H
|
|
||||||
#define TCLAP_HELP_VISITOR_H
|
|
||||||
|
|
||||||
#include <tclap/CmdLineInterface.h>
|
|
||||||
#include <tclap/CmdLineOutput.h>
|
|
||||||
#include <tclap/Visitor.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Visitor object that calls the usage method of the given CmdLineOutput
|
|
||||||
* object for the specified CmdLine object.
|
|
||||||
*/
|
|
||||||
class HelpVisitor: public Visitor
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying.
|
|
||||||
*/
|
|
||||||
HelpVisitor(const HelpVisitor& rhs);
|
|
||||||
HelpVisitor& operator=(const HelpVisitor& rhs);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The CmdLine the output will be generated for.
|
|
||||||
*/
|
|
||||||
CmdLineInterface* _cmd;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The output object.
|
|
||||||
*/
|
|
||||||
CmdLineOutput** _out;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param cmd - The CmdLine the output will be generated for.
|
|
||||||
* \param out - The type of output.
|
|
||||||
*/
|
|
||||||
HelpVisitor(CmdLineInterface* cmd, CmdLineOutput** out)
|
|
||||||
: Visitor(), _cmd( cmd ), _out( out ) { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls the usage method of the CmdLineOutput for the
|
|
||||||
* specified CmdLine.
|
|
||||||
*/
|
|
||||||
void visit() { (*_out)->usage(*_cmd); throw ExitException(0); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,54 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: IgnoreRestVisitor.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* 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,
|
|
||||||
* 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_IGNORE_REST_VISITOR_H
|
|
||||||
#define TCLAP_IGNORE_REST_VISITOR_H
|
|
||||||
|
|
||||||
#include <tclap/Visitor.h>
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Visitor that tells the CmdLine to begin ignoring arguments after
|
|
||||||
* this one is parsed.
|
|
||||||
*/
|
|
||||||
class IgnoreRestVisitor: public Visitor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*/
|
|
||||||
IgnoreRestVisitor() : Visitor() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets Arg::_ignoreRest.
|
|
||||||
*/
|
|
||||||
void visit() { Arg::beginIgnoring(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
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
|
|
@ -1,556 +0,0 @@
|
|||||||
# 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:
|
|
@ -1,433 +0,0 @@
|
|||||||
// -*- 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
|
|
||||||
* 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,
|
|
||||||
* 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_MULTIPLE_ARGUMENT_H
|
|
||||||
#define TCLAP_MULTIPLE_ARGUMENT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
#include <tclap/Constraint.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
/**
|
|
||||||
* An argument that allows multiple values of type T to be specified. Very
|
|
||||||
* similar to a ValueArg, except a vector of values will be returned
|
|
||||||
* instead of just one.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
class MultiArg : public Arg
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef std::vector<T> container_type;
|
|
||||||
typedef typename container_type::iterator iterator;
|
|
||||||
typedef typename container_type::const_iterator const_iterator;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The list of values parsed from the CmdLine.
|
|
||||||
*/
|
|
||||||
std::vector<T> _values;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The description of type T to be used in the usage.
|
|
||||||
*/
|
|
||||||
std::string _typeDesc;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of constraint on this Arg.
|
|
||||||
*/
|
|
||||||
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 - The string to be read.
|
|
||||||
*/
|
|
||||||
void _extractValue( const std::string& val );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used by XorHandler to decide whether to keep parsing for this arg.
|
|
||||||
*/
|
|
||||||
bool _allowMore;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 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.
|
|
||||||
*/
|
|
||||||
MultiArg( const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
Visitor* v = NULL);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 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.
|
|
||||||
*/
|
|
||||||
MultiArg( const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 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.
|
|
||||||
*/
|
|
||||||
MultiArg( const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 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.
|
|
||||||
*/
|
|
||||||
MultiArg( const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
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 from main().
|
|
||||||
*/
|
|
||||||
virtual bool processArg(int* i, std::vector<std::string>& args);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a vector of type T containing the values parsed from
|
|
||||||
* the command line.
|
|
||||||
*/
|
|
||||||
const std::vector<T>& getValue() const { return _values; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an iterator over the values parsed from the command
|
|
||||||
* line.
|
|
||||||
*/
|
|
||||||
const_iterator begin() const { return _values.begin(); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the end of the values parsed from the command
|
|
||||||
* line.
|
|
||||||
*/
|
|
||||||
const_iterator end() const { return _values.end(); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the a short id string. Used in the usage.
|
|
||||||
* \param val - value to be used.
|
|
||||||
*/
|
|
||||||
virtual std::string shortID(const std::string& val="val") const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the a long id string. Used in the usage.
|
|
||||||
* \param val - value to be used.
|
|
||||||
*/
|
|
||||||
virtual std::string longID(const std::string& val="val") const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Once we've matched the first value, then the arg is no longer
|
|
||||||
* required.
|
|
||||||
*/
|
|
||||||
virtual bool isRequired() const;
|
|
||||||
|
|
||||||
virtual bool allowMore();
|
|
||||||
|
|
||||||
virtual void reset();
|
|
||||||
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying
|
|
||||||
*/
|
|
||||||
MultiArg(const MultiArg<T>& rhs);
|
|
||||||
MultiArg& operator=(const MultiArg<T>& rhs);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
MultiArg<T>::MultiArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
Visitor* v) :
|
|
||||||
Arg( flag, name, desc, req, true, v ),
|
|
||||||
_values(std::vector<T>()),
|
|
||||||
_typeDesc( typeDesc ),
|
|
||||||
_constraint( NULL ),
|
|
||||||
_allowMore(false)
|
|
||||||
{
|
|
||||||
_acceptsMultipleValues = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
MultiArg<T>::MultiArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
Visitor* v)
|
|
||||||
: Arg( flag, name, desc, req, true, v ),
|
|
||||||
_values(std::vector<T>()),
|
|
||||||
_typeDesc( typeDesc ),
|
|
||||||
_constraint( NULL ),
|
|
||||||
_allowMore(false)
|
|
||||||
{
|
|
||||||
parser.add( this );
|
|
||||||
_acceptsMultipleValues = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
MultiArg<T>::MultiArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
Visitor* v)
|
|
||||||
: Arg( flag, name, desc, req, true, v ),
|
|
||||||
_values(std::vector<T>()),
|
|
||||||
_typeDesc( Constraint<T>::shortID(constraint) ),
|
|
||||||
_constraint( constraint ),
|
|
||||||
_allowMore(false)
|
|
||||||
{
|
|
||||||
_acceptsMultipleValues = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
MultiArg<T>::MultiArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
Visitor* v)
|
|
||||||
: Arg( flag, name, desc, req, true, v ),
|
|
||||||
_values(std::vector<T>()),
|
|
||||||
_typeDesc( Constraint<T>::shortID(constraint) ),
|
|
||||||
_constraint( constraint ),
|
|
||||||
_allowMore(false)
|
|
||||||
{
|
|
||||||
parser.add( this );
|
|
||||||
_acceptsMultipleValues = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool MultiArg<T>::processArg(int *i, std::vector<std::string>& args)
|
|
||||||
{
|
|
||||||
if ( _ignoreable && Arg::ignoreRest() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( _hasBlanks( args[*i] ) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
std::string flag = args[*i];
|
|
||||||
std::string value = "";
|
|
||||||
|
|
||||||
trimFlag( flag, value );
|
|
||||||
|
|
||||||
if ( argMatches( flag ) )
|
|
||||||
{
|
|
||||||
if ( Arg::delimiter() != ' ' && value == "" )
|
|
||||||
throw( ArgParseException(
|
|
||||||
"Couldn't find delimiter for this argument!",
|
|
||||||
toString() ) );
|
|
||||||
|
|
||||||
// always take the first one, regardless of start string
|
|
||||||
if ( value == "" )
|
|
||||||
{
|
|
||||||
(*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 );
|
|
||||||
|
|
||||||
/*
|
|
||||||
// continuing taking the args until we hit one with a start string
|
|
||||||
while ( (unsigned int)(*i)+1 < args.size() &&
|
|
||||||
args[(*i)+1].find_first_of( Arg::flagStartString() ) != 0 &&
|
|
||||||
args[(*i)+1].find_first_of( Arg::nameStartString() ) != 0 )
|
|
||||||
_extractValue( args[++(*i)] );
|
|
||||||
*/
|
|
||||||
|
|
||||||
_alreadySet = true;
|
|
||||||
_checkWithVisitor();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
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) + " ...";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
std::string MultiArg<T>::longID(const std::string& val) const
|
|
||||||
{
|
|
||||||
static_cast<void>(val); // Ignore input, don't warn
|
|
||||||
return Arg::longID(_typeDesc) + " (accepted multiple times)";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Once we've matched the first value, then the arg is no longer
|
|
||||||
* required.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
bool MultiArg<T>::isRequired() const
|
|
||||||
{
|
|
||||||
if ( _required )
|
|
||||||
{
|
|
||||||
if ( _values.size() > 1 )
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void MultiArg<T>::_extractValue( const std::string& val )
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
T tmp;
|
|
||||||
ExtractValue(tmp, val, typename ArgTraits<T>::ValueCategory());
|
|
||||||
_values.push_back(tmp);
|
|
||||||
} catch( ArgParseException &e) {
|
|
||||||
throw ArgParseException(e.error(), toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( _constraint != NULL )
|
|
||||||
if ( ! _constraint->check( _values.back() ) )
|
|
||||||
throw( CmdLineParseException( "Value '" + val +
|
|
||||||
"' does not meet constraint: " +
|
|
||||||
_constraint->description(),
|
|
||||||
toString() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool MultiArg<T>::allowMore()
|
|
||||||
{
|
|
||||||
bool am = _allowMore;
|
|
||||||
_allowMore = true;
|
|
||||||
return am;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void MultiArg<T>::reset()
|
|
||||||
{
|
|
||||||
Arg::reset();
|
|
||||||
_values.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,217 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: MultiSwitchArg.h
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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_MULTI_SWITCH_ARG_H
|
|
||||||
#define TCLAP_MULTI_SWITCH_ARG_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <tclap/SwitchArg.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A multiple switch argument. If the switch is set on the command line, then
|
|
||||||
* the getValue method will return the number of times the switch appears.
|
|
||||||
*/
|
|
||||||
class MultiSwitchArg : public SwitchArg
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the switch.
|
|
||||||
*/
|
|
||||||
int _value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to support the reset() method so that ValueArg can be
|
|
||||||
* reset to their constructed value.
|
|
||||||
*/
|
|
||||||
int _default;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MultiSwitchArg 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 init - Optional. The initial/default value of this Arg.
|
|
||||||
* Defaults to 0.
|
|
||||||
* \param v - An optional visitor. You probably should not
|
|
||||||
* use this unless you have a very good reason.
|
|
||||||
*/
|
|
||||||
MultiSwitchArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
int init = 0,
|
|
||||||
Visitor* v = NULL);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MultiSwitchArg 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 init - Optional. The initial/default value of this Arg.
|
|
||||||
* Defaults to 0.
|
|
||||||
* \param v - An optional visitor. You probably should not
|
|
||||||
* use this unless you have a very good reason.
|
|
||||||
*/
|
|
||||||
MultiSwitchArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
int init = 0,
|
|
||||||
Visitor* v = NULL);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the processing of the argument.
|
|
||||||
* This re-implements the SwitchArg 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);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns int, the number of times the switch has been set.
|
|
||||||
*/
|
|
||||||
int getValue() const { return _value; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the shortID for this Arg.
|
|
||||||
*/
|
|
||||||
std::string shortID(const std::string& val) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the longID for this Arg.
|
|
||||||
*/
|
|
||||||
std::string longID(const std::string& val) const;
|
|
||||||
|
|
||||||
void reset();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//BEGIN MultiSwitchArg.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
inline MultiSwitchArg::MultiSwitchArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
int init,
|
|
||||||
Visitor* v )
|
|
||||||
: SwitchArg(flag, name, desc, false, v),
|
|
||||||
_value( init ),
|
|
||||||
_default( init )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
inline MultiSwitchArg::MultiSwitchArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
int init,
|
|
||||||
Visitor* v )
|
|
||||||
: SwitchArg(flag, name, desc, false, v),
|
|
||||||
_value( init ),
|
|
||||||
_default( init )
|
|
||||||
{
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool MultiSwitchArg::processArg(int *i, std::vector<std::string>& args)
|
|
||||||
{
|
|
||||||
if ( _ignoreable && Arg::ignoreRest() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( argMatches( args[*i] ))
|
|
||||||
{
|
|
||||||
// so the isSet() method will work
|
|
||||||
_alreadySet = true;
|
|
||||||
|
|
||||||
// Matched argument: increment value.
|
|
||||||
++_value;
|
|
||||||
|
|
||||||
_checkWithVisitor();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if ( combinedSwitchesMatch( args[*i] ) )
|
|
||||||
{
|
|
||||||
// so the isSet() method will work
|
|
||||||
_alreadySet = true;
|
|
||||||
|
|
||||||
// Matched argument: increment value.
|
|
||||||
++_value;
|
|
||||||
|
|
||||||
// Check for more in argument and increment value.
|
|
||||||
while ( combinedSwitchesMatch( args[*i] ) )
|
|
||||||
++_value;
|
|
||||||
|
|
||||||
_checkWithVisitor();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string
|
|
||||||
MultiSwitchArg::shortID(const std::string& val) const
|
|
||||||
{
|
|
||||||
return Arg::shortID(val) + " ...";
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string
|
|
||||||
MultiSwitchArg::longID(const std::string& val) const
|
|
||||||
{
|
|
||||||
return Arg::longID(val) + " (accepted multiple times)";
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void
|
|
||||||
MultiSwitchArg::reset()
|
|
||||||
{
|
|
||||||
MultiSwitchArg::_value = MultiSwitchArg::_default;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//END MultiSwitchArg.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,64 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: OptionalUnlabeledTracker.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2005, Michael E. Smoot .
|
|
||||||
* 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,
|
|
||||||
* 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_OPTIONAL_UNLABELED_TRACKER_H
|
|
||||||
#define TCLAP_OPTIONAL_UNLABELED_TRACKER_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
class OptionalUnlabeledTracker
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
static void check( bool req, const std::string& argName );
|
|
||||||
|
|
||||||
static void gotOptional() { alreadyOptionalRef() = true; }
|
|
||||||
|
|
||||||
static bool& alreadyOptional() { return alreadyOptionalRef(); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
static bool& alreadyOptionalRef() { static bool ct = false; return ct; }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
inline void OptionalUnlabeledTracker::check( bool req, const std::string& argName )
|
|
||||||
{
|
|
||||||
if ( OptionalUnlabeledTracker::alreadyOptional() )
|
|
||||||
throw( SpecificationException(
|
|
||||||
"You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg",
|
|
||||||
argName ) );
|
|
||||||
|
|
||||||
if ( !req )
|
|
||||||
OptionalUnlabeledTracker::gotOptional();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,63 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// This is an internal tclap file, you should probably not have to
|
|
||||||
// include this directly
|
|
||||||
|
|
||||||
#ifndef TCLAP_STANDARD_TRAITS_H
|
|
||||||
#define TCLAP_STANDARD_TRAITS_H
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h> // To check for long long
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// If Microsoft has already typedef'd wchar_t as an unsigned
|
|
||||||
// short, then compiles will break because it's as if we're
|
|
||||||
// creating ArgTraits twice for unsigned short. Thus...
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#ifndef _NATIVE_WCHAR_T_DEFINED
|
|
||||||
#define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
// Integer types (signed, unsigned and bool) and floating point types all
|
|
||||||
// have value-like semantics.
|
|
||||||
|
|
||||||
// Strings have string like argument traits.
|
|
||||||
template<>
|
|
||||||
struct ArgTraits<std::string> {
|
|
||||||
typedef StringLike ValueCategory;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void SetString(T &dst, const std::string &src)
|
|
||||||
{
|
|
||||||
dst = src;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,300 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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_STDCMDLINEOUTPUT_H
|
|
||||||
#define TCLAP_STDCMDLINEOUTPUT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <tclap/CmdLineInterface.h>
|
|
||||||
#include <tclap/CmdLineOutput.h>
|
|
||||||
#include <tclap/XorHandler.h>
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A class that isolates any output from the CmdLine object so that it
|
|
||||||
* may be easily modified.
|
|
||||||
*/
|
|
||||||
class StdOutput : public CmdLineOutput
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the usage to stdout. Can be overridden to
|
|
||||||
* produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void usage(CmdLineInterface& c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the version to stdout. Can be overridden
|
|
||||||
* to produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void version(CmdLineInterface& c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints (to stderr) an error message, short usage
|
|
||||||
* Can be overridden to produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
* \param e - The ArgException that caused the failure.
|
|
||||||
*/
|
|
||||||
virtual void failure(CmdLineInterface& c,
|
|
||||||
ArgException& e );
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a brief usage message with short args.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
* \param os - The stream to write the message to.
|
|
||||||
*/
|
|
||||||
void _shortUsage( CmdLineInterface& c, std::ostream& os ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a longer usage message with long and short args,
|
|
||||||
* provides descriptions and prints message.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
* \param os - The stream to write the message to.
|
|
||||||
*/
|
|
||||||
void _longUsage( CmdLineInterface& c, std::ostream& os ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function inserts line breaks and indents long strings
|
|
||||||
* according the params input. It will only break lines at spaces,
|
|
||||||
* commas and pipes.
|
|
||||||
* \param os - The stream to be printed to.
|
|
||||||
* \param s - The string to be printed.
|
|
||||||
* \param maxWidth - The maxWidth allowed for the output line.
|
|
||||||
* \param indentSpaces - The number of spaces to indent the first line.
|
|
||||||
* \param secondLineOffset - The number of spaces to indent the second
|
|
||||||
* and all subsequent lines in addition to indentSpaces.
|
|
||||||
*/
|
|
||||||
void spacePrint( std::ostream& os,
|
|
||||||
const std::string& s,
|
|
||||||
int maxWidth,
|
|
||||||
int indentSpaces,
|
|
||||||
int secondLineOffset ) const;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
inline void StdOutput::version(CmdLineInterface& _cmd)
|
|
||||||
{
|
|
||||||
std::string progName = _cmd.getProgramName();
|
|
||||||
std::string xversion = _cmd.getVersion();
|
|
||||||
|
|
||||||
std::cout << std::endl << progName << " version: "
|
|
||||||
<< xversion << std::endl << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void StdOutput::usage(CmdLineInterface& _cmd )
|
|
||||||
{
|
|
||||||
std::cout << std::endl << "USAGE: " << std::endl << std::endl;
|
|
||||||
|
|
||||||
_shortUsage( _cmd, std::cout );
|
|
||||||
|
|
||||||
std::cout << std::endl << std::endl << "Where: " << std::endl << std::endl;
|
|
||||||
|
|
||||||
_longUsage( _cmd, std::cout );
|
|
||||||
|
|
||||||
std::cout << std::endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void StdOutput::failure( CmdLineInterface& _cmd,
|
|
||||||
ArgException& e )
|
|
||||||
{
|
|
||||||
std::string progName = _cmd.getProgramName();
|
|
||||||
|
|
||||||
std::cerr << "PARSE ERROR: " << e.argId() << std::endl
|
|
||||||
<< " " << e.error() << std::endl << std::endl;
|
|
||||||
|
|
||||||
if ( _cmd.hasHelpAndVersion() )
|
|
||||||
{
|
|
||||||
std::cerr << "Brief USAGE: " << std::endl;
|
|
||||||
|
|
||||||
_shortUsage( _cmd, std::cerr );
|
|
||||||
|
|
||||||
std::cerr << std::endl << "For complete USAGE and HELP type: "
|
|
||||||
<< std::endl << " " << progName << " "
|
|
||||||
<< Arg::nameStartString() << "help"
|
|
||||||
<< std::endl << std::endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
usage(_cmd);
|
|
||||||
|
|
||||||
throw ExitException(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void
|
|
||||||
StdOutput::_shortUsage( CmdLineInterface& _cmd,
|
|
||||||
std::ostream& os ) const
|
|
||||||
{
|
|
||||||
std::list<Arg*> argList = _cmd.getArgList();
|
|
||||||
std::string progName = _cmd.getProgramName();
|
|
||||||
XorHandler xorHandler = _cmd.getXorHandler();
|
|
||||||
std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
|
|
||||||
|
|
||||||
std::string s = progName + " ";
|
|
||||||
|
|
||||||
// first the xor
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < xorList.size(); i++ )
|
|
||||||
{
|
|
||||||
s += " {";
|
|
||||||
for ( ArgVectorIterator it = xorList[i].begin();
|
|
||||||
it != xorList[i].end(); it++ )
|
|
||||||
s += (*it)->shortID() + "|";
|
|
||||||
|
|
||||||
s[s.length()-1] = '}';
|
|
||||||
}
|
|
||||||
|
|
||||||
// then the rest
|
|
||||||
for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
|
|
||||||
if ( !xorHandler.contains( (*it) ) )
|
|
||||||
s += " " + (*it)->shortID();
|
|
||||||
|
|
||||||
// if the program name is too long, then adjust the second line offset
|
|
||||||
int secondLineOffset = static_cast<int>(progName.length()) + 2;
|
|
||||||
if ( secondLineOffset > 75/2 )
|
|
||||||
secondLineOffset = static_cast<int>(75/2);
|
|
||||||
|
|
||||||
spacePrint( os, s, 75, 3, secondLineOffset );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void
|
|
||||||
StdOutput::_longUsage( CmdLineInterface& _cmd,
|
|
||||||
std::ostream& os ) const
|
|
||||||
{
|
|
||||||
std::list<Arg*> argList = _cmd.getArgList();
|
|
||||||
std::string message = _cmd.getMessage();
|
|
||||||
XorHandler xorHandler = _cmd.getXorHandler();
|
|
||||||
std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
|
|
||||||
|
|
||||||
// first the xor
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < xorList.size(); i++ )
|
|
||||||
{
|
|
||||||
for ( ArgVectorIterator it = xorList[i].begin();
|
|
||||||
it != xorList[i].end();
|
|
||||||
it++ )
|
|
||||||
{
|
|
||||||
spacePrint( os, (*it)->longID(), 75, 3, 3 );
|
|
||||||
spacePrint( os, (*it)->getDescription(), 75, 5, 0 );
|
|
||||||
|
|
||||||
if ( it+1 != xorList[i].end() )
|
|
||||||
spacePrint(os, "-- OR --", 75, 9, 0);
|
|
||||||
}
|
|
||||||
os << std::endl << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// then the rest
|
|
||||||
for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
|
|
||||||
if ( !xorHandler.contains( (*it) ) )
|
|
||||||
{
|
|
||||||
spacePrint( os, (*it)->longID(), 75, 3, 3 );
|
|
||||||
spacePrint( os, (*it)->getDescription(), 75, 5, 0 );
|
|
||||||
os << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
os << std::endl;
|
|
||||||
|
|
||||||
spacePrint( os, message, 75, 3, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void StdOutput::spacePrint( std::ostream& os,
|
|
||||||
const std::string& s,
|
|
||||||
int maxWidth,
|
|
||||||
int indentSpaces,
|
|
||||||
int secondLineOffset ) const
|
|
||||||
{
|
|
||||||
int len = static_cast<int>(s.length());
|
|
||||||
|
|
||||||
if ( (len + indentSpaces > maxWidth) && maxWidth > 0 )
|
|
||||||
{
|
|
||||||
int allowedLen = maxWidth - indentSpaces;
|
|
||||||
int start = 0;
|
|
||||||
while ( start < len )
|
|
||||||
{
|
|
||||||
// find the substring length
|
|
||||||
// int stringLen = std::min<int>( len - start, allowedLen );
|
|
||||||
// doing it this way to support a VisualC++ 2005 bug
|
|
||||||
using namespace std;
|
|
||||||
int stringLen = min<int>( len - start, allowedLen );
|
|
||||||
|
|
||||||
// trim the length so it doesn't end in middle of a word
|
|
||||||
if ( stringLen == allowedLen )
|
|
||||||
while ( stringLen >= 0 &&
|
|
||||||
s[stringLen+start] != ' ' &&
|
|
||||||
s[stringLen+start] != ',' &&
|
|
||||||
s[stringLen+start] != '|' )
|
|
||||||
stringLen--;
|
|
||||||
|
|
||||||
// ok, the word is longer than the line, so just split
|
|
||||||
// wherever the line ends
|
|
||||||
if ( stringLen <= 0 )
|
|
||||||
stringLen = allowedLen;
|
|
||||||
|
|
||||||
// check for newlines
|
|
||||||
for ( int i = 0; i < stringLen; i++ )
|
|
||||||
if ( s[start+i] == '\n' )
|
|
||||||
stringLen = i+1;
|
|
||||||
|
|
||||||
// print the indent
|
|
||||||
for ( int i = 0; i < indentSpaces; i++ )
|
|
||||||
os << " ";
|
|
||||||
|
|
||||||
if ( start == 0 )
|
|
||||||
{
|
|
||||||
// handle second line offsets
|
|
||||||
indentSpaces += secondLineOffset;
|
|
||||||
|
|
||||||
// adjust allowed len
|
|
||||||
allowedLen -= secondLineOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
os << s.substr(start,stringLen) << std::endl;
|
|
||||||
|
|
||||||
// so we don't start a line with a space
|
|
||||||
while ( s[stringLen+start] == ' ' && start < len )
|
|
||||||
start++;
|
|
||||||
|
|
||||||
start += stringLen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for ( int i = 0; i < indentSpaces; i++ )
|
|
||||||
os << " ";
|
|
||||||
os << s << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
#endif
|
|
@ -1,273 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: SwitchArg.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,
|
|
||||||
* 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
|
|
||||||
#define TCLAP_SWITCH_ARG_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple switch argument. If the switch is set on the command line, then
|
|
||||||
* the getValue method will return the opposite of the default value for the
|
|
||||||
* switch.
|
|
||||||
*/
|
|
||||||
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() 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 )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void SwitchArg::commonProcessing()
|
|
||||||
{
|
|
||||||
if ( _xorSet )
|
|
||||||
throw(CmdLineParseException(
|
|
||||||
"Mutually exclusive argument already set!", toString()));
|
|
||||||
|
|
||||||
if ( _alreadySet )
|
|
||||||
throw(CmdLineParseException("Argument already set!", toString()));
|
|
||||||
|
|
||||||
_alreadySet = true;
|
|
||||||
|
|
||||||
if ( _value == true )
|
|
||||||
_value = false;
|
|
||||||
else
|
|
||||||
_value = true;
|
|
||||||
|
|
||||||
_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void SwitchArg::reset()
|
|
||||||
{
|
|
||||||
Arg::reset();
|
|
||||||
_value = _default;
|
|
||||||
}
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//End SwitchArg.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,304 +0,0 @@
|
|||||||
// -*- 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
|
|
||||||
* 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,
|
|
||||||
* 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_MULTIPLE_UNLABELED_ARGUMENT_H
|
|
||||||
#define TCLAP_MULTIPLE_UNLABELED_ARGUMENT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <tclap/MultiArg.h>
|
|
||||||
#include <tclap/OptionalUnlabeledTracker.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Just like a MultiArg, except that the arguments are unlabeled. Basically,
|
|
||||||
* this Arg will slurp up everything that hasn't been matched to another
|
|
||||||
* Arg.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
class UnlabeledMultiArg : public MultiArg<T>
|
|
||||||
{
|
|
||||||
|
|
||||||
// If compiler has two stage name lookup (as gcc >= 3.4 does)
|
|
||||||
// this is required to prevent undef. symbols
|
|
||||||
using MultiArg<T>::_ignoreable;
|
|
||||||
using MultiArg<T>::_hasBlanks;
|
|
||||||
using MultiArg<T>::_extractValue;
|
|
||||||
using MultiArg<T>::_typeDesc;
|
|
||||||
using MultiArg<T>::_name;
|
|
||||||
using MultiArg<T>::_description;
|
|
||||||
using MultiArg<T>::_alreadySet;
|
|
||||||
using MultiArg<T>::toString;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param name - The name of the Arg. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \param desc - A description of what the argument is for or
|
|
||||||
* does.
|
|
||||||
* \param req - Whether the argument is required 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 ignoreable - Whether or not this argument can be ignored
|
|
||||||
* using the "--" flag.
|
|
||||||
* \param v - An optional visitor. You probably should not
|
|
||||||
* use this unless you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledMultiArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
bool ignoreable = false,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param name - The name of the Arg. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \param desc - A description of what the argument is for or
|
|
||||||
* does.
|
|
||||||
* \param req - Whether the argument is required 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 ignoreable - Whether or not this argument can be ignored
|
|
||||||
* using the "--" flag.
|
|
||||||
* \param v - An optional visitor. You probably should not
|
|
||||||
* use this unless you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledMultiArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable = false,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param name - The name of the Arg. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \param desc - A description of what the argument is for or
|
|
||||||
* does.
|
|
||||||
* \param req - Whether the argument is required on the command
|
|
||||||
* line.
|
|
||||||
* \param constraint - A pointer to a Constraint object used
|
|
||||||
* to constrain this Arg.
|
|
||||||
* \param ignoreable - Whether or not this argument can be ignored
|
|
||||||
* using the "--" flag.
|
|
||||||
* \param v - An optional visitor. You probably should not
|
|
||||||
* use this unless you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledMultiArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
bool ignoreable = false,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param name - The name of the Arg. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \param desc - A description of what the argument is for or
|
|
||||||
* does.
|
|
||||||
* \param req - Whether the argument is required 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 ignoreable - Whether or not this argument can be ignored
|
|
||||||
* using the "--" flag.
|
|
||||||
* \param v - An optional visitor. You probably should not
|
|
||||||
* use this unless you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledMultiArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable = 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. 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 from main().
|
|
||||||
*/
|
|
||||||
virtual bool processArg(int* i, std::vector<std::string>& args);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the a short id string. Used in the usage.
|
|
||||||
* \param val - value to be used.
|
|
||||||
*/
|
|
||||||
virtual std::string shortID(const std::string& val="val") const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the a long id string. Used in the usage.
|
|
||||||
* \param val - value to be used.
|
|
||||||
*/
|
|
||||||
virtual std::string longID(const std::string& val="val") const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Operator ==.
|
|
||||||
* \param a - The Arg to be compared to this.
|
|
||||||
*/
|
|
||||||
virtual bool operator==(const Arg& a) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pushes this to back of list rather than front.
|
|
||||||
* \param argList - The list this should be added to.
|
|
||||||
*/
|
|
||||||
virtual void addToList( std::list<Arg*>& argList ) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: MultiArg<T>("", name, desc, req, typeDesc, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(true, toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: MultiArg<T>("", name, desc, req, typeDesc, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(true, toString());
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: MultiArg<T>("", name, desc, req, constraint, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(true, toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
UnlabeledMultiArg<T>::UnlabeledMultiArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: MultiArg<T>("", name, desc, req, constraint, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(true, toString());
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool UnlabeledMultiArg<T>::processArg(int *i, std::vector<std::string>& args)
|
|
||||||
{
|
|
||||||
|
|
||||||
if ( _hasBlanks( args[*i] ) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// never ignore an unlabeled multi arg
|
|
||||||
|
|
||||||
|
|
||||||
// always take the first value, regardless of the start string
|
|
||||||
_extractValue( args[(*i)] );
|
|
||||||
|
|
||||||
/*
|
|
||||||
// continue taking args until we hit the end or a start string
|
|
||||||
while ( (unsigned int)(*i)+1 < args.size() &&
|
|
||||||
args[(*i)+1].find_first_of( Arg::flagStartString() ) != 0 &&
|
|
||||||
args[(*i)+1].find_first_of( Arg::nameStartString() ) != 0 )
|
|
||||||
_extractValue( args[++(*i)] );
|
|
||||||
*/
|
|
||||||
|
|
||||||
_alreadySet = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
std::string UnlabeledMultiArg<T>::shortID(const std::string& val) const
|
|
||||||
{
|
|
||||||
static_cast<void>(val); // Ignore input, don't warn
|
|
||||||
return std::string("<") + _typeDesc + "> ...";
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
std::string UnlabeledMultiArg<T>::longID(const std::string& val) const
|
|
||||||
{
|
|
||||||
static_cast<void>(val); // Ignore input, don't warn
|
|
||||||
return std::string("<") + _typeDesc + "> (accepted multiple times)";
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool UnlabeledMultiArg<T>::operator==(const Arg& a) const
|
|
||||||
{
|
|
||||||
if ( _name == a.getName() || _description == a.getDescription() )
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void UnlabeledMultiArg<T>::addToList( std::list<Arg*>& argList ) const
|
|
||||||
{
|
|
||||||
argList.push_back( const_cast<Arg*>(static_cast<const Arg* const>(this)) );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,343 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: UnlabeledValueArg.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,
|
|
||||||
* 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_UNLABELED_VALUE_ARGUMENT_H
|
|
||||||
#define TCLAP_UNLABELED_VALUE_ARGUMENT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <tclap/ValueArg.h>
|
|
||||||
#include <tclap/OptionalUnlabeledTracker.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The basic unlabeled argument that parses a value.
|
|
||||||
* This is a template class, which means the type T defines the type
|
|
||||||
* that a given object will attempt to parse when an UnlabeledValueArg
|
|
||||||
* is reached in the list of args that the CmdLine iterates over.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
class UnlabeledValueArg : public ValueArg<T>
|
|
||||||
{
|
|
||||||
|
|
||||||
// If compiler has two stage name lookup (as gcc >= 3.4 does)
|
|
||||||
// this is required to prevent undef. symbols
|
|
||||||
using ValueArg<T>::_ignoreable;
|
|
||||||
using ValueArg<T>::_hasBlanks;
|
|
||||||
using ValueArg<T>::_extractValue;
|
|
||||||
using ValueArg<T>::_typeDesc;
|
|
||||||
using ValueArg<T>::_name;
|
|
||||||
using ValueArg<T>::_description;
|
|
||||||
using ValueArg<T>::_alreadySet;
|
|
||||||
using ValueArg<T>::toString;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UnlabeledValueArg constructor.
|
|
||||||
* \param name - A one word name for the argument. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \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 ignoreable - Allows you to specify that this argument can be
|
|
||||||
* ignored if the '--' flag is set. This defaults to false (cannot
|
|
||||||
* be ignored) and should generally stay that way unless you have
|
|
||||||
* some special need for certain arguments to be ignored.
|
|
||||||
* \param v - Optional Visitor. You should leave this blank unless
|
|
||||||
* you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledValueArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T value,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
bool ignoreable = false,
|
|
||||||
Visitor* v = NULL);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UnlabeledValueArg constructor.
|
|
||||||
* \param name - A one word name for the argument. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \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 ignoreable - Allows you to specify that this argument can be
|
|
||||||
* ignored if the '--' flag is set. This defaults to false (cannot
|
|
||||||
* be ignored) and should generally stay that way unless you have
|
|
||||||
* some special need for certain arguments to be ignored.
|
|
||||||
* \param v - Optional Visitor. You should leave this blank unless
|
|
||||||
* you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledValueArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T value,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable = false,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UnlabeledValueArg constructor.
|
|
||||||
* \param name - A one word name for the argument. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \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 ignoreable - Allows you to specify that this argument can be
|
|
||||||
* ignored if the '--' flag is set. This defaults to false (cannot
|
|
||||||
* be ignored) and should generally stay that way unless you have
|
|
||||||
* some special need for certain arguments to be ignored.
|
|
||||||
* \param v - Optional Visitor. You should leave this blank unless
|
|
||||||
* you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledValueArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T value,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
bool ignoreable = false,
|
|
||||||
Visitor* v = NULL );
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UnlabeledValueArg constructor.
|
|
||||||
* \param name - A one word name for the argument. Note that this is used for
|
|
||||||
* identification, not as a long flag.
|
|
||||||
* \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 ignoreable - Allows you to specify that this argument can be
|
|
||||||
* ignored if the '--' flag is set. This defaults to false (cannot
|
|
||||||
* be ignored) and should generally stay that way unless you have
|
|
||||||
* some special need for certain arguments to be ignored.
|
|
||||||
* \param v - Optional Visitor. You should leave this blank unless
|
|
||||||
* you have a very good reason.
|
|
||||||
*/
|
|
||||||
UnlabeledValueArg( const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T value,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable = 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. Handling specific to
|
|
||||||
* unlabeled arguments.
|
|
||||||
* \param i - Pointer the the current argument in the list.
|
|
||||||
* \param args - Mutable list of strings.
|
|
||||||
*/
|
|
||||||
virtual bool processArg(int* i, std::vector<std::string>& args);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides shortID for specific behavior.
|
|
||||||
*/
|
|
||||||
virtual std::string shortID(const std::string& val="val") const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides longID for specific behavior.
|
|
||||||
*/
|
|
||||||
virtual std::string longID(const std::string& val="val") const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides operator== for specific behavior.
|
|
||||||
*/
|
|
||||||
virtual bool operator==(const Arg& a ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instead of pushing to the front of list, push to the back.
|
|
||||||
* \param argList - The list to add this to.
|
|
||||||
*/
|
|
||||||
virtual void addToList( std::list<Arg*>& argList ) const;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor implementation.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: ValueArg<T>("", name, desc, req, val, typeDesc, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
|
|
||||||
OptionalUnlabeledTracker::check(req, toString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: ValueArg<T>("", name, desc, req, val, typeDesc, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(req, toString());
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor implementation.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: ValueArg<T>("", name, desc, req, val, constraint, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(req, toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
UnlabeledValueArg<T>::UnlabeledValueArg(const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
bool ignoreable,
|
|
||||||
Visitor* v)
|
|
||||||
: ValueArg<T>("", name, desc, req, val, constraint, v)
|
|
||||||
{
|
|
||||||
_ignoreable = ignoreable;
|
|
||||||
OptionalUnlabeledTracker::check(req, toString());
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of processArg().
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
bool UnlabeledValueArg<T>::processArg(int *i, std::vector<std::string>& args)
|
|
||||||
{
|
|
||||||
|
|
||||||
if ( _alreadySet )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( _hasBlanks( args[*i] ) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// never ignore an unlabeled arg
|
|
||||||
|
|
||||||
_extractValue( args[*i] );
|
|
||||||
_alreadySet = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overriding shortID for specific output.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
std::string UnlabeledValueArg<T>::shortID(const std::string& val) const
|
|
||||||
{
|
|
||||||
static_cast<void>(val); // Ignore input, don't warn
|
|
||||||
return std::string("<") + _typeDesc + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overriding longID for specific output.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
std::string UnlabeledValueArg<T>::longID(const std::string& val) const
|
|
||||||
{
|
|
||||||
static_cast<void>(val); // Ignore input, don't warn
|
|
||||||
|
|
||||||
// Ideally we would like to be able to use RTTI to return the name
|
|
||||||
// of the type required for this argument. However, g++ at least,
|
|
||||||
// doesn't appear to return terribly useful "names" of the types.
|
|
||||||
return std::string("<") + _typeDesc + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overriding operator== for specific behavior.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
bool UnlabeledValueArg<T>::operator==(const Arg& a ) const
|
|
||||||
{
|
|
||||||
if ( _name == a.getName() || _description == a.getDescription() )
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void UnlabeledValueArg<T>::addToList( std::list<Arg*>& argList ) const
|
|
||||||
{
|
|
||||||
argList.push_back( const_cast<Arg*>(static_cast<const Arg* const>(this)) );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1,430 +0,0 @@
|
|||||||
// -*- 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,
|
|
||||||
* 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
|
|
||||||
#define TCLAP_VALUE_ARGUMENT_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
#include <tclap/Constraint.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The basic labeled argument that parses a value.
|
|
||||||
* This is a template class, which means the type T defines the type
|
|
||||||
* that a given object will attempt to parse when the flag/name is matched
|
|
||||||
* on the command line. While there is nothing stopping you from creating
|
|
||||||
* an unflagged ValueArg, it is unwise and would cause significant problems.
|
|
||||||
* Instead use an UnlabeledValueArg.
|
|
||||||
*/
|
|
||||||
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 );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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() ;
|
|
||||||
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying
|
|
||||||
*/
|
|
||||||
ValueArg(const ValueArg<T>& rhs);
|
|
||||||
ValueArg& operator=(const ValueArg<T>& rhs);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor implementation.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
ValueArg<T>::ValueArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
Visitor* v)
|
|
||||||
: Arg(flag, name, desc, req, true, v),
|
|
||||||
_value( val ),
|
|
||||||
_default( val ),
|
|
||||||
_typeDesc( typeDesc ),
|
|
||||||
_constraint( NULL )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
ValueArg<T>::ValueArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
const std::string& typeDesc,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
Visitor* v)
|
|
||||||
: Arg(flag, name, desc, req, true, v),
|
|
||||||
_value( val ),
|
|
||||||
_default( val ),
|
|
||||||
_typeDesc( typeDesc ),
|
|
||||||
_constraint( NULL )
|
|
||||||
{
|
|
||||||
parser.add( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
ValueArg<T>::ValueArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
Visitor* v)
|
|
||||||
: Arg(flag, name, desc, req, true, v),
|
|
||||||
_value( val ),
|
|
||||||
_default( val ),
|
|
||||||
_typeDesc( Constraint<T>::shortID(constraint) ),
|
|
||||||
_constraint( constraint )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
ValueArg<T>::ValueArg(const std::string& flag,
|
|
||||||
const std::string& name,
|
|
||||||
const std::string& desc,
|
|
||||||
bool req,
|
|
||||||
T val,
|
|
||||||
Constraint<T>* constraint,
|
|
||||||
CmdLineInterface& parser,
|
|
||||||
Visitor* v)
|
|
||||||
: 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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of processArg().
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
bool ValueArg<T>::processArg(int *i, std::vector<std::string>& args)
|
|
||||||
{
|
|
||||||
if ( _ignoreable && Arg::ignoreRest() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( _hasBlanks( args[*i] ) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
std::string flag = args[*i];
|
|
||||||
|
|
||||||
std::string value = "";
|
|
||||||
trimFlag( flag, value );
|
|
||||||
|
|
||||||
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 == "" )
|
|
||||||
{
|
|
||||||
(*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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of shortID.
|
|
||||||
*/
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of longID.
|
|
||||||
*/
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,134 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* 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,
|
|
||||||
* 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_VALUESCONSTRAINT_H
|
|
||||||
#define TCLAP_VALUESCONSTRAINT_H
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <tclap/Constraint.h>
|
|
||||||
#include <tclap/sstream.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Constraint that constrains the Arg to only those values specified
|
|
||||||
* in the constraint.
|
|
||||||
*/
|
|
||||||
template<class T>
|
|
||||||
class ValuesConstraint : public Constraint<T>
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param allowed - vector of allowed values.
|
|
||||||
*/
|
|
||||||
ValuesConstraint(std::vector<T>const& allowed);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Virtual destructor.
|
|
||||||
*/
|
|
||||||
virtual ~ValuesConstraint() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a description of the Constraint.
|
|
||||||
*/
|
|
||||||
virtual std::string description() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the short ID for the Constraint.
|
|
||||||
*/
|
|
||||||
virtual std::string shortID() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The method used to verify that the value parsed from the command
|
|
||||||
* line meets the constraint.
|
|
||||||
* \param value - The value that will be checked.
|
|
||||||
*/
|
|
||||||
virtual bool check(const T& value) const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The list of valid values.
|
|
||||||
*/
|
|
||||||
std::vector<T> _allowed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The string used to describe the allowed values of this constraint.
|
|
||||||
*/
|
|
||||||
std::string _typeDesc;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
ValuesConstraint<T>::ValuesConstraint(std::vector<T> const& allowed)
|
|
||||||
: _allowed(allowed),
|
|
||||||
_typeDesc("")
|
|
||||||
{
|
|
||||||
for ( unsigned int i = 0; i < _allowed.size(); i++ )
|
|
||||||
{
|
|
||||||
std::ostringstream os;
|
|
||||||
os << _allowed[i];
|
|
||||||
|
|
||||||
std::string temp( os.str() );
|
|
||||||
|
|
||||||
if ( i > 0 )
|
|
||||||
_typeDesc += "|";
|
|
||||||
_typeDesc += temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool ValuesConstraint<T>::check( const T& val ) const
|
|
||||||
{
|
|
||||||
if ( std::find(_allowed.begin(),_allowed.end(),val) == _allowed.end() )
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
std::string ValuesConstraint<T>::shortID() const
|
|
||||||
{
|
|
||||||
return _typeDesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
std::string ValuesConstraint<T>::description() const
|
|
||||||
{
|
|
||||||
return _typeDesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: VersionVisitor.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* 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,
|
|
||||||
* 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_VERSION_VISITOR_H
|
|
||||||
#define TCLAP_VERSION_VISITOR_H
|
|
||||||
|
|
||||||
#include <tclap/CmdLineInterface.h>
|
|
||||||
#include <tclap/CmdLineOutput.h>
|
|
||||||
#include <tclap/Visitor.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Visitor that will call the version method of the given CmdLineOutput
|
|
||||||
* for the specified CmdLine object and then exit.
|
|
||||||
*/
|
|
||||||
class VersionVisitor: public Visitor
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* Prevent accidental copying
|
|
||||||
*/
|
|
||||||
VersionVisitor(const VersionVisitor& rhs);
|
|
||||||
VersionVisitor& operator=(const VersionVisitor& rhs);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The CmdLine of interest.
|
|
||||||
*/
|
|
||||||
CmdLineInterface* _cmd;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The output object.
|
|
||||||
*/
|
|
||||||
CmdLineOutput** _out;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* \param cmd - The CmdLine the output is generated for.
|
|
||||||
* \param out - The type of output.
|
|
||||||
*/
|
|
||||||
VersionVisitor( CmdLineInterface* cmd, CmdLineOutput** out )
|
|
||||||
: Visitor(), _cmd( cmd ), _out( out ) { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls the version method of the output object using the
|
|
||||||
* specified CmdLine.
|
|
||||||
*/
|
|
||||||
void visit() {
|
|
||||||
(*_out)->version(*_cmd);
|
|
||||||
throw ExitException(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,57 +0,0 @@
|
|||||||
// -*- 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
|
|
||||||
* 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,
|
|
||||||
* 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_VISITOR_H
|
|
||||||
#define TCLAP_VISITOR_H
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A base class that defines the interface for visitors.
|
|
||||||
*/
|
|
||||||
class Visitor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor. Does nothing.
|
|
||||||
*/
|
|
||||||
Visitor() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor. Does nothing.
|
|
||||||
*/
|
|
||||||
virtual ~Visitor() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method (to implemented by children) will be
|
|
||||||
* called when the visitor is visited.
|
|
||||||
*/
|
|
||||||
virtual void visit() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,168 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: XorHandler.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno.
|
|
||||||
* 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,
|
|
||||||
* 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_XORHANDLER_H
|
|
||||||
#define TCLAP_XORHANDLER_H
|
|
||||||
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class handles lists of Arg's that are to be XOR'd on the command
|
|
||||||
* line. This is used by CmdLine and you shouldn't ever use it.
|
|
||||||
*/
|
|
||||||
class XorHandler
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The list of of lists of Arg's to be or'd together.
|
|
||||||
*/
|
|
||||||
std::vector< std::vector<Arg*> > _orList;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor. Does nothing.
|
|
||||||
*/
|
|
||||||
XorHandler( ) : _orList(std::vector< std::vector<Arg*> >()) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a list of Arg*'s that will be xor'd together.
|
|
||||||
* \param ors - list of Arg* that will be xor'd.
|
|
||||||
*/
|
|
||||||
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
|
|
||||||
* Arg matched. If the Arg matches, then it also sets the rest of
|
|
||||||
* the Arg's in the list. You shouldn't use this.
|
|
||||||
* \param a - The Arg to be checked.
|
|
||||||
*/
|
|
||||||
int check( const Arg* a );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the XOR specific short usage.
|
|
||||||
*/
|
|
||||||
std::string shortUsage();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the XOR specific long usage.
|
|
||||||
* \param os - Stream to print to.
|
|
||||||
*/
|
|
||||||
void printLongUsage(std::ostream& os);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Simply checks whether the Arg is contained in one of the arg
|
|
||||||
* lists.
|
|
||||||
* \param a - The Arg to be checked.
|
|
||||||
*/
|
|
||||||
bool contains( const Arg* a );
|
|
||||||
|
|
||||||
const std::vector< std::vector<Arg*> >& getXorList() const;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//BEGIN XOR.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
inline void XorHandler::add( const std::vector<Arg*>& ors )
|
|
||||||
{
|
|
||||||
_orList.push_back( ors );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int XorHandler::check( const Arg* a )
|
|
||||||
{
|
|
||||||
// iterate over each XOR list
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < _orList.size(); i++ )
|
|
||||||
{
|
|
||||||
// if the XOR list contains the arg..
|
|
||||||
ArgVectorIterator ait = std::find( _orList[i].begin(),
|
|
||||||
_orList[i].end(), a );
|
|
||||||
if ( ait != _orList[i].end() )
|
|
||||||
{
|
|
||||||
// first check to see if a mutually exclusive switch
|
|
||||||
// has not already been set
|
|
||||||
for ( ArgVectorIterator it = _orList[i].begin();
|
|
||||||
it != _orList[i].end();
|
|
||||||
it++ )
|
|
||||||
if ( a != (*it) && (*it)->isSet() )
|
|
||||||
throw(CmdLineParseException(
|
|
||||||
"Mutually exclusive argument already set!",
|
|
||||||
(*it)->toString()));
|
|
||||||
|
|
||||||
// go through and set each arg that is not a
|
|
||||||
for ( ArgVectorIterator it = _orList[i].begin();
|
|
||||||
it != _orList[i].end();
|
|
||||||
it++ )
|
|
||||||
if ( a != (*it) )
|
|
||||||
(*it)->xorSet();
|
|
||||||
|
|
||||||
// return the number of required args that have now been set
|
|
||||||
if ( (*ait)->allowMore() )
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return static_cast<int>(_orList[i].size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( a->isRequired() )
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool XorHandler::contains( const Arg* a )
|
|
||||||
{
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < _orList.size(); i++ )
|
|
||||||
for ( ArgVectorIterator it = _orList[i].begin();
|
|
||||||
it != _orList[i].end();
|
|
||||||
it++ )
|
|
||||||
if ( a == (*it) )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const std::vector< std::vector<Arg*> >& XorHandler::getXorList() const
|
|
||||||
{
|
|
||||||
return _orList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
//END XOR.cpp
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,336 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: ZshCompletionOutput.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2006, Oliver Kiddle
|
|
||||||
* Copyright (c) 2017 Google Inc.
|
|
||||||
* 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,
|
|
||||||
* 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_ZSHCOMPLETIONOUTPUT_H
|
|
||||||
#define TCLAP_ZSHCOMPLETIONOUTPUT_H
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
|
||||||
#include <iostream>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include <tclap/CmdLineInterface.h>
|
|
||||||
#include <tclap/CmdLineOutput.h>
|
|
||||||
#include <tclap/XorHandler.h>
|
|
||||||
#include <tclap/Arg.h>
|
|
||||||
#include <tclap/sstream.h>
|
|
||||||
|
|
||||||
namespace TCLAP {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A class that generates a Zsh completion function as output from the usage()
|
|
||||||
* method for the given CmdLine and its Args.
|
|
||||||
*/
|
|
||||||
class ZshCompletionOutput : public CmdLineOutput
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
ZshCompletionOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the usage to stdout. Can be overridden to
|
|
||||||
* produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void usage(CmdLineInterface& c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the version to stdout. Can be overridden
|
|
||||||
* to produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
*/
|
|
||||||
virtual void version(CmdLineInterface& c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints (to stderr) an error message, short usage
|
|
||||||
* Can be overridden to produce alternative behavior.
|
|
||||||
* \param c - The CmdLine object the output is generated for.
|
|
||||||
* \param e - The ArgException that caused the failure.
|
|
||||||
*/
|
|
||||||
virtual void failure(CmdLineInterface& c,
|
|
||||||
ArgException& e );
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
void basename( std::string& s );
|
|
||||||
void quoteSpecialChars( std::string& s );
|
|
||||||
|
|
||||||
std::string getMutexList( CmdLineInterface& _cmd, Arg* a );
|
|
||||||
void printOption( Arg* it, std::string mutex );
|
|
||||||
void printArg( Arg* it );
|
|
||||||
|
|
||||||
std::map<std::string, std::string> common;
|
|
||||||
char theDelimiter;
|
|
||||||
};
|
|
||||||
|
|
||||||
ZshCompletionOutput::ZshCompletionOutput()
|
|
||||||
: common(std::map<std::string, std::string>()),
|
|
||||||
theDelimiter('=')
|
|
||||||
{
|
|
||||||
common["host"] = "_hosts";
|
|
||||||
common["hostname"] = "_hosts";
|
|
||||||
common["file"] = "_files";
|
|
||||||
common["filename"] = "_files";
|
|
||||||
common["user"] = "_users";
|
|
||||||
common["username"] = "_users";
|
|
||||||
common["directory"] = "_directories";
|
|
||||||
common["path"] = "_directories";
|
|
||||||
common["url"] = "_urls";
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::version(CmdLineInterface& _cmd)
|
|
||||||
{
|
|
||||||
std::cout << _cmd.getVersion() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::usage(CmdLineInterface& _cmd )
|
|
||||||
{
|
|
||||||
std::list<Arg*> argList = _cmd.getArgList();
|
|
||||||
std::string progName = _cmd.getProgramName();
|
|
||||||
std::string xversion = _cmd.getVersion();
|
|
||||||
theDelimiter = _cmd.getDelimiter();
|
|
||||||
basename(progName);
|
|
||||||
|
|
||||||
std::cout << "#compdef " << progName << std::endl << std::endl <<
|
|
||||||
"# " << progName << " version " << _cmd.getVersion() << std::endl << std::endl <<
|
|
||||||
"_arguments -s -S";
|
|
||||||
|
|
||||||
for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
|
|
||||||
{
|
|
||||||
if ( (*it)->shortID().at(0) == '<' )
|
|
||||||
printArg((*it));
|
|
||||||
else if ( (*it)->getFlag() != "-" )
|
|
||||||
printOption((*it), getMutexList(_cmd, *it));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::failure( CmdLineInterface& _cmd,
|
|
||||||
ArgException& e )
|
|
||||||
{
|
|
||||||
static_cast<void>(_cmd); // unused
|
|
||||||
std::cout << e.what() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::quoteSpecialChars( std::string& s )
|
|
||||||
{
|
|
||||||
size_t idx = s.find_last_of(':');
|
|
||||||
while ( idx != std::string::npos )
|
|
||||||
{
|
|
||||||
s.insert(idx, 1, '\\');
|
|
||||||
idx = s.find_last_of(':', idx);
|
|
||||||
}
|
|
||||||
idx = s.find_last_of('\'');
|
|
||||||
while ( idx != std::string::npos )
|
|
||||||
{
|
|
||||||
s.insert(idx, "'\\'");
|
|
||||||
if (idx == 0)
|
|
||||||
idx = std::string::npos;
|
|
||||||
else
|
|
||||||
idx = s.find_last_of('\'', --idx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::basename( std::string& s )
|
|
||||||
{
|
|
||||||
size_t p = s.find_last_of('/');
|
|
||||||
if ( p != std::string::npos )
|
|
||||||
{
|
|
||||||
s.erase(0, p + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::printArg(Arg* a)
|
|
||||||
{
|
|
||||||
static int count = 1;
|
|
||||||
|
|
||||||
std::cout << " \\" << std::endl << " '";
|
|
||||||
if ( a->acceptsMultipleValues() )
|
|
||||||
std::cout << '*';
|
|
||||||
else
|
|
||||||
std::cout << count++;
|
|
||||||
std::cout << ':';
|
|
||||||
if ( !a->isRequired() )
|
|
||||||
std::cout << ':';
|
|
||||||
|
|
||||||
std::cout << a->getName() << ':';
|
|
||||||
std::map<std::string, std::string>::iterator compArg = common.find(a->getName());
|
|
||||||
if ( compArg != common.end() )
|
|
||||||
{
|
|
||||||
std::cout << compArg->second;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cout << "_guard \"^-*\" " << a->getName();
|
|
||||||
}
|
|
||||||
std::cout << '\'';
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex)
|
|
||||||
{
|
|
||||||
std::string flag = a->flagStartChar() + a->getFlag();
|
|
||||||
std::string name = a->nameStartString() + a->getName();
|
|
||||||
std::string desc = a->getDescription();
|
|
||||||
|
|
||||||
// remove full stop and capitalization from description as
|
|
||||||
// this is the convention for zsh function
|
|
||||||
if (!desc.compare(0, 12, "(required) "))
|
|
||||||
{
|
|
||||||
desc.erase(0, 12);
|
|
||||||
}
|
|
||||||
if (!desc.compare(0, 15, "(OR required) "))
|
|
||||||
{
|
|
||||||
desc.erase(0, 15);
|
|
||||||
}
|
|
||||||
size_t len = desc.length();
|
|
||||||
if (len && desc.at(--len) == '.')
|
|
||||||
{
|
|
||||||
desc.erase(len);
|
|
||||||
}
|
|
||||||
if (len)
|
|
||||||
{
|
|
||||||
desc.replace(0, 1, 1, tolower(desc.at(0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << " \\" << std::endl << " '" << mutex;
|
|
||||||
|
|
||||||
if ( a->getFlag().empty() )
|
|
||||||
{
|
|
||||||
std::cout << name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cout << "'{" << flag << ',' << name << "}'";
|
|
||||||
}
|
|
||||||
if ( theDelimiter == '=' && a->isValueRequired() )
|
|
||||||
std::cout << "=-";
|
|
||||||
quoteSpecialChars(desc);
|
|
||||||
std::cout << '[' << desc << ']';
|
|
||||||
|
|
||||||
if ( a->isValueRequired() )
|
|
||||||
{
|
|
||||||
std::string arg = a->shortID();
|
|
||||||
// Example arg: "[-A <integer>] ..."
|
|
||||||
size_t pos = arg.rfind(" ...");
|
|
||||||
|
|
||||||
if (pos != std::string::npos) {
|
|
||||||
arg.erase(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
arg.erase(0, arg.find_last_of(theDelimiter) + 1);
|
|
||||||
if ( arg.at(arg.length()-1) == ']' )
|
|
||||||
arg.erase(arg.length()-1);
|
|
||||||
if ( arg.at(arg.length()-1) == ']' )
|
|
||||||
{
|
|
||||||
arg.erase(arg.length()-1);
|
|
||||||
}
|
|
||||||
if ( arg.at(0) == '<' )
|
|
||||||
{
|
|
||||||
arg.erase(arg.length()-1);
|
|
||||||
arg.erase(0, 1);
|
|
||||||
}
|
|
||||||
size_t p = arg.find('|');
|
|
||||||
if ( p != std::string::npos )
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
arg.replace(p, 1, 1, ' ');
|
|
||||||
}
|
|
||||||
while ( (p = arg.find_first_of('|', p)) != std::string::npos );
|
|
||||||
quoteSpecialChars(arg);
|
|
||||||
std::cout << ": :(" << arg << ')';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cout << ':' << arg;
|
|
||||||
std::map<std::string, std::string>::iterator compArg = common.find(arg);
|
|
||||||
if ( compArg != common.end() )
|
|
||||||
{
|
|
||||||
std::cout << ':' << compArg->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << '\'';
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::string ZshCompletionOutput::getMutexList( CmdLineInterface& _cmd, Arg* a)
|
|
||||||
{
|
|
||||||
XorHandler xorHandler = _cmd.getXorHandler();
|
|
||||||
std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();
|
|
||||||
|
|
||||||
if (a->getName() == "help" || a->getName() == "version")
|
|
||||||
{
|
|
||||||
return "(-)";
|
|
||||||
}
|
|
||||||
|
|
||||||
ostringstream list;
|
|
||||||
if ( a->acceptsMultipleValues() )
|
|
||||||
{
|
|
||||||
list << '*';
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( int i = 0; static_cast<unsigned int>(i) < xorList.size(); i++ )
|
|
||||||
{
|
|
||||||
for ( ArgVectorIterator it = xorList[i].begin();
|
|
||||||
it != xorList[i].end();
|
|
||||||
it++)
|
|
||||||
if ( a == (*it) )
|
|
||||||
{
|
|
||||||
list << '(';
|
|
||||||
for ( ArgVectorIterator iu = xorList[i].begin();
|
|
||||||
iu != xorList[i].end();
|
|
||||||
iu++ )
|
|
||||||
{
|
|
||||||
bool notCur = (*iu) != a;
|
|
||||||
bool hasFlag = !(*iu)->getFlag().empty();
|
|
||||||
if ( iu != xorList[i].begin() && (notCur || hasFlag) )
|
|
||||||
list << ' ';
|
|
||||||
if (hasFlag)
|
|
||||||
list << (*iu)->flagStartChar() << (*iu)->getFlag() << ' ';
|
|
||||||
if ( notCur || hasFlag )
|
|
||||||
list << (*iu)->nameStartString() << (*iu)->getName();
|
|
||||||
}
|
|
||||||
list << ')';
|
|
||||||
return list.str();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// wasn't found in xor list
|
|
||||||
if (!a->getFlag().empty()) {
|
|
||||||
list << "(" << a->flagStartChar() << a->getFlag() << ' ' <<
|
|
||||||
a->nameStartString() << a->getName() << ')';
|
|
||||||
}
|
|
||||||
|
|
||||||
return list.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
} //namespace TCLAP
|
|
||||||
#endif
|
|
@ -1,50 +0,0 @@
|
|||||||
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* file: sstream.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2003, Michael E. Smoot .
|
|
||||||
* Copyright (c) 2004, Michael E. Smoot, Daniel Aarno .
|
|
||||||
* Copyright (c) 2017 Google Inc.
|
|
||||||
* 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,
|
|
||||||
* 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_SSTREAM_H
|
|
||||||
#define TCLAP_SSTREAM_H
|
|
||||||
|
|
||||||
#if !defined(HAVE_STRSTREAM)
|
|
||||||
// Assume sstream is available if strstream is not specified
|
|
||||||
// (https://sourceforge.net/p/tclap/bugs/23/)
|
|
||||||
#define HAVE_SSTREAM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_SSTREAM)
|
|
||||||
#include <sstream>
|
|
||||||
namespace TCLAP {
|
|
||||||
typedef std::istringstream istringstream;
|
|
||||||
typedef std::ostringstream ostringstream;
|
|
||||||
}
|
|
||||||
#elif defined(HAVE_STRSTREAM)
|
|
||||||
#include <strstream>
|
|
||||||
namespace TCLAP {
|
|
||||||
typedef std::istrstream istringstream;
|
|
||||||
typedef std::ostrstream ostringstream;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#error "Need a stringstream (sstream or strstream) to compile!"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // TCLAP_SSTREAM_H
|
|
@ -1,9 +0,0 @@
|
|||||||
SUBDIRS = examples
|
|
||||||
|
|
||||||
EXTRA_DIST = README\
|
|
||||||
tclap-beta.ncb\
|
|
||||||
tclap-beta.sln\
|
|
||||||
tclap-beta.suo\
|
|
||||||
tclap-beta.vcproj
|
|
||||||
|
|
||||||
|
|
@ -1,594 +0,0 @@
|
|||||||
# 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 = msc
|
|
||||||
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 $(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 =
|
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
|
||||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
|
||||||
install-data-recursive install-dvi-recursive \
|
|
||||||
install-exec-recursive install-html-recursive \
|
|
||||||
install-info-recursive install-pdf-recursive \
|
|
||||||
install-ps-recursive install-recursive installcheck-recursive \
|
|
||||||
installdirs-recursive pdf-recursive ps-recursive \
|
|
||||||
tags-recursive uninstall-recursive
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
|
||||||
distclean-recursive maintainer-clean-recursive
|
|
||||||
am__recursive_targets = \
|
|
||||||
$(RECURSIVE_TARGETS) \
|
|
||||||
$(RECURSIVE_CLEAN_TARGETS) \
|
|
||||||
$(am__extra_recursive_targets)
|
|
||||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
|
||||||
distdir distdir-am
|
|
||||||
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)`
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
|
||||||
$(top_srcdir)/config/mkinstalldirs README
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
am__relativize = \
|
|
||||||
dir0=`pwd`; \
|
|
||||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
|
||||||
sed_rest='s,^[^/]*/*,,'; \
|
|
||||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
|
||||||
sed_butlast='s,/*[^/]*$$,,'; \
|
|
||||||
while test -n "$$dir1"; do \
|
|
||||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first" != "."; then \
|
|
||||||
if test "$$first" = ".."; then \
|
|
||||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
|
||||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
|
||||||
else \
|
|
||||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first2" = "$$first"; then \
|
|
||||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
|
||||||
else \
|
|
||||||
dir2="../$$dir2"; \
|
|
||||||
fi; \
|
|
||||||
dir0="$$dir0"/"$$first"; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
|
||||||
done; \
|
|
||||||
reldir="$$dir2"
|
|
||||||
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@
|
|
||||||
SUBDIRS = examples
|
|
||||||
EXTRA_DIST = README\
|
|
||||||
tclap-beta.ncb\
|
|
||||||
tclap-beta.sln\
|
|
||||||
tclap-beta.suo\
|
|
||||||
tclap-beta.vcproj
|
|
||||||
|
|
||||||
all: all-recursive
|
|
||||||
|
|
||||||
.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 msc/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu msc/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):
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
|
||||||
# into them and run 'make' without going through this Makefile.
|
|
||||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
|
||||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
|
||||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
|
||||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
|
||||||
$(am__recursive_targets):
|
|
||||||
@fail=; \
|
|
||||||
if $(am__make_keepgoing); then \
|
|
||||||
failcom='fail=yes'; \
|
|
||||||
else \
|
|
||||||
failcom='exit 1'; \
|
|
||||||
fi; \
|
|
||||||
dot_seen=no; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
case "$@" in \
|
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
dot_seen=yes; \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| eval $$failcom; \
|
|
||||||
done; \
|
|
||||||
if test "$$dot_seen" = "no"; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|
||||||
fi; test -z "$$fail"
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-recursive
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
|
||||||
include_option=--etags-include; \
|
|
||||||
empty_fix=.; \
|
|
||||||
else \
|
|
||||||
include_option=--include; \
|
|
||||||
empty_fix=; \
|
|
||||||
fi; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test ! -f $$subdir/TAGS || \
|
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
$(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-recursive
|
|
||||||
|
|
||||||
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-recursive
|
|
||||||
|
|
||||||
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
|
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
$(am__make_dryrun) \
|
|
||||||
|| test -d "$(distdir)/$$subdir" \
|
|
||||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|
||||||
|| exit 1; \
|
|
||||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_distdir=$$reldir; \
|
|
||||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_top_distdir=$$reldir; \
|
|
||||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
|
||||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
|
||||||
($(am__cd) $$subdir && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$$new_top_distdir" \
|
|
||||||
distdir="$$new_distdir" \
|
|
||||||
am__remove_distdir=: \
|
|
||||||
am__skip_length_check=: \
|
|
||||||
am__skip_mode_fix=: \
|
|
||||||
distdir) \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-recursive
|
|
||||||
all-am: Makefile
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
installdirs-am:
|
|
||||||
install: install-recursive
|
|
||||||
install-exec: install-exec-recursive
|
|
||||||
install-data: install-data-recursive
|
|
||||||
uninstall: uninstall-recursive
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
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-recursive
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-recursive
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-dvi: install-dvi-recursive
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-recursive
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-recursive
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-recursive
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-recursive
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-recursive
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-recursive
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: $(am__recursive_targets) 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-man install-pdf install-pdf-am \
|
|
||||||
install-ps install-ps-am install-strip installcheck \
|
|
||||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
|
||||||
pdf-am ps ps-am tags tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.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:
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user