debut main.c
This commit is contained in:
parent
e3af6a25f9
commit
5d524ee451
36
main.c
Normal file
36
main.c
Normal file
@ -0,0 +1,36 @@
|
||||
// deployer main programm
|
||||
// Copyright (C) 2024 Jean-Cloud
|
||||
// GNU General Public License v3
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int DEPLOY=false;
|
||||
int REMOVE=false;
|
||||
|
||||
void help()
|
||||
{
|
||||
printf("usage: ./deployer action file \n with action=deploy or remove and file=path to a file or all. \n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3){
|
||||
printf("Invalid number of arguments. \n");
|
||||
help();
|
||||
exit(1);
|
||||
} else {
|
||||
if (strcmp(argv[1], "deploy")==0){
|
||||
DEPLOY=true;
|
||||
} else if (strcmp(argv[1], "remove")==0){
|
||||
REMOVE=true;
|
||||
} else {
|
||||
printf("Invalid argument. \n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user