myMPD
Internal API documentation
Loading...
Searching...
No Matches
handle_options.c File Reference

Command line options handling. More...

#include "compile_time.h"
#include "src/lib/handle_options.h"
#include "src/lib/config.h"
#include "src/lib/config_def.h"
#include "src/lib/pin.h"
#include "src/lib/sds_extras.h"
#include "src/lib/utility.h"
#include <getopt.h>
#include <openssl/opensslv.h>
Include dependency graph for handle_options.c:

Functions

static void print_usage (struct t_config *config, const char *cmd)
 
static void print_version (void)
 
enum handle_options_rc handle_options (struct t_config *config, int argc, char **argv)
 

Variables

static struct option long_options []
 

Detailed Description

Command line options handling.

Function Documentation

◆ handle_options()

enum handle_options_rc handle_options ( struct t_config config,
int  argc,
char **  argv 
)

Handles the command line arguments

Parameters
configpointer to myMPD static configuration
argcfrom main function
argvfrom main function
Returns
OPTIONS_RC_INVALID on error OPTIONS_RC_EXIT if myMPD should exit OPTIONS_RC_OK if arguments are parsed successfully

◆ print_usage()

static void print_usage ( struct t_config config,
const char *  cmd 
)
static

Prints the command line usage information

Parameters
configpointer to config struct
cmdargv[0] from main function

◆ print_version()

static void print_version ( void  )
static

Prints the command line usage information

Variable Documentation

◆ long_options

struct option long_options[]
static
Initial value:
= {
{"cachedir", required_argument, 0, 'a'},
{"config", no_argument, 0, 'c'},
{"dump", no_argument, 0, 'd'},
{"help", no_argument, 0, 'h'},
{"pin", no_argument, 0, 'p'},
{"syslog", no_argument, 0, 's'},
{"version", no_argument, 0, 'v'},
{"workdir", required_argument, 0, 'w'}
}

Options definitions