diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-04-27 06:57:51 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-04-27 06:57:51 +0300 |
commit | ac6fbacce69ad8d53099f1e6ab922c2e4bd6f9cc (patch) | |
tree | 1e2306bfaad26233f805467b52b956b3dcd431f4 /c_implementation/src/ak_fs_main.c | |
parent | 698c607b8cad8ef22eee3ef4b196cbe648070a05 (diff) | |
download | arching-kaos-tools-ac6fbacce69ad8d53099f1e6ab922c2e4bd6f9cc.tar.gz arching-kaos-tools-ac6fbacce69ad8d53099f1e6ab922c2e4bd6f9cc.tar.bz2 arching-kaos-tools-ac6fbacce69ad8d53099f1e6ab922c2e4bd6f9cc.zip |
Updates.. better file names
Diffstat (limited to 'c_implementation/src/ak_fs_main.c')
-rw-r--r-- | c_implementation/src/ak_fs_main.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/c_implementation/src/ak_fs_main.c b/c_implementation/src/ak_fs_main.c new file mode 100644 index 0000000..f1660cf --- /dev/null +++ b/c_implementation/src/ak_fs_main.c @@ -0,0 +1,43 @@ +#include <getopt.h> +#include <stdio.h> +#include <libaklog.h> +#include <libakfs.h> + +static int ak_fs_usage() +{ + ak_log_debug(__func__, "Available commands:"); + ak_log_debug(__func__, "ak fs --list"); + return 1; +} + +int ak_fs_main(int argc, char** argv) +{ + int option; + int logind = 0; + static struct option long_options[] = { + {"help", no_argument, 0, 'h'}, + {"list", no_argument, 0, 'l'}, + {0,0,0,0} + }; + while(1) + { + option = getopt_long(argc, argv, "hl", long_options, &logind); + if ( option == -1 ) return ak_fs_usage(); + switch(option) + { + case 'h': + return ak_fs_usage(); + case 'l': + return ak_fs_ls(); + default: + printf("double lol\n"); + return 4; + } + } + return 0; +} + +int main(int argc, char **argv) +{ + return ak_fs_main(argc, argv); +} |