-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.h
38 lines (31 loc) · 850 Bytes
/
commands.h
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
31
32
33
34
35
36
37
38
#ifndef COMMANDS_H
#define COMMANDS_H
#include "logs.h"
#include <stdbool.h>
typedef enum {
CREATE = 0,
EXTRACT,
LIST,
DELETE,
UPDATE,
VERBOSE,
USE_FILE,
APPEND,
PACK,
HELP,
UNKNOWN
} Flags;
int handleCommands(int argumentCount, char *argumentList[]);
int callCommands(Flags command, char *files[], int fileCount, char *filename);
Flags getFromSimpleFlag(char *flag);
Flags determineFlag(char *flag);
void getFlags(int argumentCount, char *argumentList[], int *flagCount,
char *flags[]);
void getFiles(int argumentCount, char *argumentList[], int *fileCount,
char *files[]);
char *getOutFilename(int argumentCount, char *argumentList[]);
char *applyColor(const char *string, AnsiColor color);
bool isFlag(char *flag);
bool isLongFlag(char *flag);
bool endsWithTar(const char *filename);
#endif