diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2020-10-20 23:37:13 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2020-10-20 23:37:13 +0200 |
commit | 7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1 (patch) | |
tree | 7ce2fc46c98cd052893f01feda8b8f212f4c8f70 /src/main.c | |
parent | db8ae62fb64fa33657f598a62045f17fc779ef8b (diff) | |
download | polecat-7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1.tar.gz polecat-7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1.zip |
improve codebase quality
- improve unreachable macro to print a message with a minor traceback then exit(0) instead of assert hackery
- add specific wine and dxvk directory methods
- rename dxvk install to download
- remove sanity asserts from lutris, caught by unreachable
- improve comments
- rename info to env
- only use a single buffer for information fetching
- fix formatting on code I had help on
- purge unused code
- if downloadToRam returns null pointer report that the archive went missing not that its invalid
- rename undescriptive "datadir" to be more specific
- remove unused code from when we stored the archive on disk
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -16,7 +16,7 @@ const static struct Command main_commands[] = { { .name = "dxvk", .func = dxvk, .description = "manage dxvk versions" }, #endif { .name = "lutris", .func = lutris, .description = "run lutris instraller"}, - { .name = "info", .func = main_info, .description = "show some information about polecat" }, + { .name = "env", .func = main_env, .description = "show some information about polecat" }, }; @@ -33,22 +33,22 @@ int main(int argc, char** argv) return main_help(argc-1, argv+1); } -int main_info(int argc, char** argv) +int main_env(int argc, char** argv) { - char cfgdir[PATH_MAX], datadir[PATH_MAX], cachedir[PATH_MAX]; + char buffer[PATH_MAX]; - getConfigDir(cfgdir, sizeof(cfgdir)); - getDataDir(datadir, sizeof(datadir)); - getCacheDir(cachedir, sizeof(cachedir)); printf("version:\t\t%s\n" - "user-Agent:\t\t%s/%s\n" - "config dir\t\t%s\n" - "data dir\t\t%s\n" - "cache dir\t\t%s\n", + "user-Agent:\t\t%s\n", VERSION, - NAME, VERSION, - cfgdir, datadir, cachedir); + USER_AGENT); + + getConfigDir(buffer, sizeof(buffer)); + printf("config dir\t\t%s\n", buffer); + + getDataDir(buffer, sizeof(buffer)); + printf("data dir\t\t%s\n", buffer); + return 0; } |