@@ -36,12 +36,12 @@ void version()
3636
3737void help (int invalid_opt = false )
3838{
39- fmt::print (R"( Usage: cufetchpm <command > [options]
39+ fmt::print (R"( Usage: cufetchpm <COMMAND > [OPTIONS]...
4040Manage plugins for customfetch.
4141
4242Commands:
43- install [options ] <repo/path>... Install one or more plugin sources from a Git repo or local path.
44- help <command > Show help for a specific command.
43+ install [OPTIONS ] <repo/path>... Install one or more plugin sources from a Git repo or local path.
44+ help <COMMAND > Show help for a specific command.
4545
4646Global options:
4747 -h, --help Show this help message.
@@ -217,11 +217,11 @@ int main(int argc, char* argv[])
217217 case INSTALL :
218218 {
219219 if (options.arguments .size () < 1 )
220- die (" Please provide a singular git url repository" );
220+ die (" Please provide a git url repository" );
221221 PluginManager plugin_manager (std::move (state));
222222 for (const std::string& arg : options.arguments )
223223 {
224- if (arg. find ( " :// " ) == arg. npos && fs::exists (arg))
224+ if (fs::exists (arg))
225225 plugin_manager.build_plugins (arg);
226226 else
227227 plugin_manager.add_repo_plugins (arg);
@@ -230,21 +230,37 @@ int main(int argc, char* argv[])
230230 }
231231 case LIST :
232232 {
233- for ( const manifest_t & manifest : state. get_all_repos () )
233+ if (options. list_verbose )
234234 {
235- fmt::println (" \033 [1;32mRepository:\033 [0m {}" , manifest.name );
236- fmt::println (" \033 [1;33mURL:\033 [0m {}" , manifest.url );
237- fmt::println (" \033 [1;34mPlugins:" );
238- for (const plugin_t & plugin : manifest.plugins )
235+ for (const manifest_t & manifest : state.get_all_repos ())
239236 {
240- fmt::println (" \033 [1;34m - {}\033 [0m" , plugin.name );
241- fmt::println (" \t\033 [1;35mDescription:\033 [0m {}" , plugin.description );
242- fmt::println (" \t\033 [1;36mAuthor(s):\033 [0m {}" , fmt::join (plugin.authors , " , " ));
243- fmt::println (" \t\033 [1;38;2;220;220;220mLicense(s):\033 [0m {}" , fmt::join (plugin.licenses , " , " ));
244- fmt::println (" \t\033 [1;38;2;144;238;144mPrefixe(s):\033 [0m {}" , fmt::join (plugin.prefixes , " , " ));
245- fmt::print (" \n " );
237+ fmt::println (" \033 [1;32mRepository:\033 [0m {}" , manifest.name );
238+ fmt::println (" \033 [1;33mURL:\033 [0m {}" , manifest.url );
239+ fmt::println (" \033 [1;34mPlugins:" );
240+ for (const plugin_t & plugin : manifest.plugins )
241+ {
242+ fmt::println (" \033 [1;34m - {}\033 [0m" , plugin.name );
243+ fmt::println (" \t\033 [1;35mDescription:\033 [0m {}" , plugin.description );
244+ fmt::println (" \t\033 [1;36mAuthor(s):\033 [0m {}" , fmt::join (plugin.authors , " , " ));
245+ fmt::println (" \t\033 [1;38;2;220;220;220mLicense(s):\033 [0m {}" ,
246+ fmt::join (plugin.licenses , " , " ));
247+ fmt::println (" \t\033 [1;38;2;144;238;144mPrefixe(s):\033 [0m {}" ,
248+ fmt::join (plugin.prefixes , " , " ));
249+ fmt::print (" \n " );
250+ }
251+ fmt::print (" \033 [0m" );
252+ }
253+ }
254+ else
255+ {
256+ for (const manifest_t & manifest : state.get_all_repos ())
257+ {
258+ fmt::println (" \033 [1;32mRepository:\033 [0m {} (\033 [1;33m{}\033 [0m)" , manifest.name , manifest.url );
259+ fmt::println (" \033 [1;34mPlugins:" );
260+ for (const plugin_t & plugin : manifest.plugins )
261+ fmt::println (" \033 [1;34m{} - \033 [1;35m{}\n " , plugin.name , plugin.description );
262+ fmt::print (" \033 [0m" );
246263 }
247- fmt::print (" \033 [0m" );
248264 }
249265 break ;
250266 }
0 commit comments