Read command-line options¶
-
class
lemon::Options: public App¶ The
Optionsclass is used to read command line arguments.A majority of Lemon workflows begin with the parsing of various command- line arguments. This class helps the user parse the most common arguments such as the directory containing the Hadoop sequence files, the number of cores to use for a given search or a preselected set of entries. Users can add their own options with the
add_optionsmember function.Public Functions
-
Options()¶ Default constructor to initialize a custom
OptionsclassThis constructor is intended for users who wish to add their own custom options. The work_dir, ncpu, and entries options are added automatically and additional options can be added with the
add_optionfunction.
-
Options(int argc, const char *const argv[])¶ Constructor for an
Optionsclass which does not use custom optionsThis constructor is indended for users who do not wish to add custom options. The work_dir, ncpu, and entries options are added automatically and the arguments are parsed immediately.
- Parameters
argc: The number of arguments plus their values plus one. Typically obtained from themainfunction.argv: The arguments and their values. Typically obtained from themainfunction.
-
template<typename
T>
CLI::Option *add_option(std::string option_name, T &variable, std::string description = "") noexcept¶ Adds an option to the current workflow
- Parameters
option_name: The name of the option on the command linevariable: The location used to store the variabledescription: The description of the new option
-
void
parse_command_line(int argc, const char *const argv[])¶ Parse the command-line arguments and update containers
Use this function to read options and update the custom contains if needed. Once the options are parsed, this function will throw an error.
- Parameters
argc: The number of arguments plus their values plus one. Typically obtained from themainfunction.argv: The arguments and their values. Typically obtained from themainfunction.
-
size_t
ncpu() const¶ Number of CPUs used to run independent jobs.
-
const std::string &
entries() const¶ Index to preselect entries. Eg a search on RCSB.
-
const std::string &
skip_entries() const¶ Index to skip entries.
-