Automatically format file with LSP via LLVM.

This commit is contained in:
Murilo Pereira 2020-06-01 15:43:53 +02:00
parent 456b66d008
commit 0ce1526c81

View File

@ -1,12 +1,12 @@
#include <stdlib.h>
#include <ncurses.h>
#include <locale.h>
#include <getopt.h>
#include <errno.h> #include <errno.h>
#include <getopt.h>
#include <locale.h>
#include <ncurses.h>
#include <stdlib.h>
#include "common.h"
#include "game.h" #include "game.h"
#include "keyboard.h" #include "keyboard.h"
#include "common.h"
#ifndef VERSION #ifndef VERSION
#define VERSION "n/a" #define VERSION "n/a"
@ -29,12 +29,12 @@ int main(int argc, char *argv[]) {
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
{"passes", required_argument, NULL, 'p'}, {"passes", required_argument, NULL, 'p'},
{"color", required_argument, NULL, 'c'}, {"color", required_argument, NULL, 'c'},
{0, 0, 0, 0} {0, 0, 0, 0}};
};
program_name = argv[0]; program_name = argv[0];
while ((option = getopt_long(argc, argv, "hvpc:", options, &option_index)) != -1) { while ((option = getopt_long(argc, argv, "hvpc:", options, &option_index)) !=
-1) {
switch (option) { switch (option) {
case 'v': case 'v':
version(); version();
@ -62,8 +62,7 @@ int main(int argc, char *argv[]) {
set_escdelay(0); set_escdelay(0);
if (color) { if (color) {
assume_default_colors(COLOR_WHITE, COLOR_GREEN); assume_default_colors(COLOR_WHITE, COLOR_GREEN);
} } else {
else {
use_default_colors(); use_default_colors();
} }
init_pair(1, COLOR_BLACK, COLOR_WHITE); init_pair(1, COLOR_BLACK, COLOR_WHITE);
@ -130,7 +129,8 @@ void draw_greeting() {
} }
void usage(const char *program_name) { void usage(const char *program_name) {
printf("usage: %s [-v|--version] [-h|--help] [-p|--passes=NUMBER]\n", program_name); printf("usage: %s [-v|--version] [-h|--help] [-p|--passes=NUMBER]\n",
program_name);
printf(" -v, --version Show version\n"); printf(" -v, --version Show version\n");
printf(" -h, --help Show this message\n"); printf(" -h, --help Show this message\n");
printf(" -p, --passes Number of passes through the deck\n"); printf(" -p, --passes Number of passes through the deck\n");
@ -138,6 +138,4 @@ void usage(const char *program_name) {
printf(" 0 - use terminal colors\n"); printf(" 0 - use terminal colors\n");
} }
void version() { void version() { printf("%s\n", VERSION); }
printf("%s\n", VERSION);
}