-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommand_line.c
More file actions
31 lines (30 loc) · 784 Bytes
/
Copy pathcommand_line.c
File metadata and controls
31 lines (30 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// jbwm - Minimalist Window Manager for X
// Copyright 2008-2020, Alisa Bedard <[email protected]>
// Copyright 1999-2015, Ciaran Anscomb <[email protected]>
// See README for license and other details.
#include "command_line.h"
//
#include "config.h"
#include "log.h"
//
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
//
void jbwm_parse_command_line(const int argc, char **argv)
{
JBWM_LOG("parse_argv(%d,%s...)", argc, argv[0]);
static const char optstring[] = "1:2:v";
int8_t opt;
while((opt = getopt(argc, argv, optstring)) != -1)
switch (opt) {
case 'v':
printf("%s version %s\n", argv[0], VERSION);
exit(0);
default:
printf("%s -[%s]\n", argv[0], optstring);
exit(1);
}
}