Skip to content

Commit

Permalink
add little config tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Jun 30, 2024
1 parent 61c9846 commit 7adf9b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ jobs:
run: make clean && make CXX=clang++ DEBUG=1 VENDOR_TEST=1 GUI_SUPPORT=0 #|| mingw-w64-clang-x86_64-make clean && mingw-w64-clang-x86_64-make DEBUG=1 VENDOR_TEST=1 GUI_SUPPORT=0

- name: Test customfetch
run: ./build/debug/cufetch -d "windows 11"
run: ./build/debug/cufetch --data-dir=assets -d "windows 11"
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static bool parseargs(int argc, char* argv[], Config& config) {
int opt = 0;
int option_index = 0;
opterr = 1; // re-enable since before we disabled for "invalid option" error
const char *optstring = "VhnlgC:d:s:";
const char *optstring = "VhnlgC:d:D:s:";
static const struct option opts[] =
{
{"version", no_argument, 0, 'V'},
Expand All @@ -142,6 +142,7 @@ static bool parseargs(int argc, char* argv[], Config& config) {
{"gui", no_argument, 0, 'g'},
{"config", required_argument, 0, 'C'},
{"distro", required_argument, 0, 'd'},
{"data-dir", required_argument, 0, 'D'},
{"source-path", required_argument, 0, 's'},
{0,0,0,0}
};
Expand Down Expand Up @@ -169,6 +170,8 @@ static bool parseargs(int argc, char* argv[], Config& config) {
continue;
case 'd':
config.m_custom_distro = str_tolower(strndup(optarg, PATH_MAX)); break;
case 'D':
config.data_dir = strndup(optarg, PATH_MAX); break;
case 's':
config.source_path = strndup(optarg, PATH_MAX); break;
default:
Expand Down

0 comments on commit 7adf9b5

Please sign in to comment.