The cmdline parser can now be used for parsing commandlines other than just what we expect for patch. This is done by factoring out a class that has a virtual process_option function. Inheriting command line handlers can implement this to interpret the given option in the application specific method.
24 lines
381 B
C++
24 lines
381 B
C++
// SPDX-License-Identifier: BSD-3-Clause
|
|
// Copyright 2022 Shannon Booth <shannon.ml.booth@gmail.com>
|
|
|
|
#include <new>
|
|
#include <patch/cmdline.h>
|
|
#include <patch/patch.h>
|
|
|
|
namespace Patch {
|
|
|
|
CmdLine::CmdLine(int, const char* const*)
|
|
{
|
|
}
|
|
|
|
int process_patch(const Options&)
|
|
{
|
|
throw std::bad_alloc();
|
|
}
|
|
|
|
void CmdLineParser::parse(CmdLineParser::Handler&)
|
|
{
|
|
}
|
|
|
|
} // namespace Patch
|