Skip to content

Commit ae51aeb

Browse files
Added option to show config path
1 parent 7ee66f7 commit ae51aeb

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Include/runcpp2/runcpp2.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace runcpp2
1818
HELP,
1919
REMOVE_DEPENDENCIES,
2020
LOCAL,
21+
SHOW_USER_CONFIG,
2122
COUNT
2223
};
2324

Src/runcpp2/main.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int main(int argc, char* argv[])
8888
//std::unordered_set<runcpp2::CmdOptions> currentOptions;
8989

9090
{
91-
static_assert(static_cast<int>(runcpp2::CmdOptions::COUNT) == 7, "Update this");
91+
static_assert(static_cast<int>(runcpp2::CmdOptions::COUNT) == 8, "Update this");
9292
std::unordered_map<std::string, runcpp2::OptionInfo> longOptionsMap =
9393
{
9494
{
@@ -114,18 +114,23 @@ int main(int argc, char* argv[])
114114
{
115115
"--local",
116116
runcpp2::OptionInfo(runcpp2::CmdOptions::LOCAL, false)
117+
},
118+
{
119+
"--show-config-path",
120+
runcpp2::OptionInfo(runcpp2::CmdOptions::SHOW_USER_CONFIG, false)
117121
}
118122
};
119123

120-
static_assert(static_cast<int>(runcpp2::CmdOptions::COUNT) == 7, "Update this");
124+
static_assert(static_cast<int>(runcpp2::CmdOptions::COUNT) == 8, "Update this");
121125
std::unordered_map<std::string, const runcpp2::OptionInfo&> shortOptionsMap =
122126
{
123127
{"-r", longOptionsMap.at("--reset-cache")},
124128
{"-c", longOptionsMap.at("--reset-user-config")},
125129
{"-e", longOptionsMap.at("--executable")},
126130
{"-h", longOptionsMap.at("--help")},
127131
{"-d", longOptionsMap.at("--remove-dependencies")},
128-
{"-l", longOptionsMap.at("--local")}
132+
{"-l", longOptionsMap.at("--local")},
133+
{"-s", longOptionsMap.at("--show-config-path")}
129134
};
130135

131136
currentArgIndex = ParseArgs(longOptionsMap, shortOptionsMap, currentOptions, argc, argv);
@@ -142,7 +147,7 @@ int main(int argc, char* argv[])
142147
//Help message
143148
if(currentOptions.count(runcpp2::CmdOptions::HELP))
144149
{
145-
static_assert(static_cast<int>(runcpp2::CmdOptions::COUNT) == 7, "Update this");
150+
static_assert(static_cast<int>(runcpp2::CmdOptions::COUNT) == 8, "Update this");
146151
ssLOG_BASE("Usage: runcpp2 [options] [input_file]");
147152
ssLOG_BASE("Options:");
148153
ssLOG_BASE(" -r, --[r]eset-cache Deletes all cache and build everything from scratch");
@@ -151,10 +156,17 @@ int main(int argc, char* argv[])
151156
ssLOG_BASE(" -h, --[h]elp Show this help message");
152157
ssLOG_BASE(" -d, --remove-[d]ependencies Remove dependencies listed in the script");
153158
ssLOG_BASE(" -l, --[l]ocal Build the script and dependencies locally");
159+
ssLOG_BASE(" -s, --[s]how-config-path Show where runcpp2 is reading the config from");
154160

155161
return 0;
156162
}
157163

164+
if(currentOptions.count(runcpp2::CmdOptions::SHOW_USER_CONFIG))
165+
{
166+
ssLOG_BASE(runcpp2::GetConfigFilePath());
167+
return 0;
168+
}
169+
158170
//Resetting user config
159171
if(currentOptions.count(runcpp2::CmdOptions::RESET_USER_CONFIG))
160172
{

TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
TODO:
2-
- Also add option to show config folder path
3-
42
- Add option to watch new changes
53
- Add option to add Default Script Info to script
64
- Add wildcard support for filenames and extensions

0 commit comments

Comments
 (0)