Read command-line options

class lemon::Options : public App

The Options class 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_options member function.

Public Functions

Options()

Default constructor to initialize a custom Options class

This 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_option function.

Options(int argc, const char *const argv[])

Constructor for an Options class which does not use custom options

This 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 the main function.

  • argv: The arguments and their values. Typically obtained from the main function.

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 line

  • variable: The location used to store the variable

  • description: 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 the main function.

  • argv: The arguments and their values. Typically obtained from the main function.

const std::string &work_dir() const

Directory containing the MMTF or Hadoop files.

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.