mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-23 03:18:59 +00:00
Expose QPDFArgParser::usage
This commit is contained in:
parent
8dcf6da259
commit
f8eee83515
@ -150,6 +150,12 @@ class QPDFArgParser
|
|||||||
QPDF_DLL
|
QPDF_DLL
|
||||||
void insertCompletion(std::string const&);
|
void insertCompletion(std::string const&);
|
||||||
|
|
||||||
|
// Throw a Usage exception with the given message. In completion
|
||||||
|
// mode, this just exits to prevent errors from partial commands
|
||||||
|
// or other error messages from messing up completion.
|
||||||
|
QPDF_DLL
|
||||||
|
void usage(std::string const& message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct OptionEntry
|
struct OptionEntry
|
||||||
{
|
{
|
||||||
@ -174,7 +180,6 @@ class QPDFArgParser
|
|||||||
void argCompletionBash();
|
void argCompletionBash();
|
||||||
void argCompletionZsh();
|
void argCompletionZsh();
|
||||||
|
|
||||||
void usage(std::string const& message);
|
|
||||||
void checkCompletion();
|
void checkCompletion();
|
||||||
void handleArgFileArguments();
|
void handleArgFileArguments();
|
||||||
void handleBashArguments();
|
void handleBashArguments();
|
||||||
|
@ -2174,15 +2174,7 @@ ArgParser::argEndCopyAttachments()
|
|||||||
void
|
void
|
||||||
ArgParser::usage(std::string const& message)
|
ArgParser::usage(std::string const& message)
|
||||||
{
|
{
|
||||||
if (this->ap.isCompleting())
|
this->ap.usage(message);
|
||||||
{
|
|
||||||
// This will cause bash to fall back to regular file completion.
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw QPDFArgParser::Usage(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int>
|
std::vector<int>
|
||||||
|
Loading…
Reference in New Issue
Block a user