wxMaxima
Loading...
Searching...
No Matches
Functions
CommandLinePrescan.h File Reference

Finding an option on the command line before it is parsed. More...

#include <wx/string.h>
#include <optional>
#include <vector>
Include dependency graph for CommandLinePrescan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::optional< wxString > wxm::cmdline::PrescanLongOption (const std::vector< wxString > &args, const wxString &name)
 The value of the long option –name, as wxCmdLineParser would read it.
 

Detailed Description

Finding an option on the command line before it is parsed.

wxMaxima sets up its UI language before wxCmdLineParser runs: the parser's own messages (an unknown option, the "Usage:" of –help) are translated through the catalogues that need the language first. An option that decides the language itself (–language) therefore has to be found by a simpler look at the arguments first. The real parser still sees it later, and checks it like any other option.

Function Documentation

◆ PrescanLongOption()

std::optional< wxString > wxm::cmdline::PrescanLongOption ( const std::vector< wxString > &  args,
const wxString &  name 
)

The value of the long option –name, as wxCmdLineParser would read it.

Understands "--name=value" and "--name value". The last occurrence wins, as it does for wxCmdLineParser. Stops at a bare "--", after which everything is a file name, and skips the program name in args[0].

Returns
the value, or no value if the option isn't there or is the last argument with nothing following it