Skip to content

Commit 088741e

Browse files
committed
Merge branch 'dev'
2 parents 135438a + 28aab04 commit 088741e

5 files changed

Lines changed: 704 additions & 10 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
*
3+
* @file OutdatedCommand.hpp
4+
* @author Gaspard Kirira
5+
*
6+
* Copyright 2025, Gaspard Kirira. All rights reserved.
7+
* https://github.com/vixcpp/vix
8+
* Use of this source code is governed by a MIT license
9+
* that can be found in the License file.
10+
*
11+
* Vix.cpp
12+
*
13+
*/
14+
#ifndef VIX_OUTDATED_COMMAND_HPP
15+
#define VIX_OUTDATED_COMMAND_HPP
16+
17+
#include <string>
18+
#include <vector>
19+
20+
namespace vix::commands
21+
{
22+
struct OutdatedCommand
23+
{
24+
static int run(const std::vector<std::string> &args);
25+
static int help();
26+
};
27+
}
28+
29+
#endif

src/CLI.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <vix/cli/commands/UninstallCommand.hpp>
4141
#include <vix/cli/commands/UnpublishCommand.hpp>
4242
#include <vix/cli/commands/UpdateCommand.hpp>
43+
#include <vix/cli/commands/OutdatedCommand.hpp>
4344
#include <vix/utils/Env.hpp>
4445
#include <vix/cli/Style.hpp>
4546
#include <vix/utils/Logger.hpp>
@@ -356,6 +357,8 @@ namespace vix
356357
return commands::AddCommand::help();
357358
if (cmd == "update")
358359
return commands::UpdateCommand::help();
360+
if (cmd == "outdated")
361+
return commands::OutdatedCommand::help();
359362
if (cmd == "search")
360363
return commands::SearchCommand::help();
361364
if (cmd == "remove")
@@ -418,6 +421,7 @@ namespace vix
418421
out << indent(1) << "Core workflow:\n";
419422
out << indent(2) << "add Add a dependency\n";
420423
out << indent(2) << "install Install project dependencies\n";
424+
out << indent(2) << "update Update dependencies\n";
421425
out << indent(2) << "run Run your app\n";
422426
out << indent(2) << "deploy Deploy your app (coming soon)\n\n";
423427

@@ -434,17 +438,21 @@ namespace vix
434438
out << indent(3) << "tests Run tests\n";
435439
out << indent(3) << "repl Interactive REPL\n\n";
436440

437-
// Registry
441+
// Dependencies
438442
out << indent(2) << "Dependencies:\n";
439443
docs("https://vixcpp.com/docs/modules/cli/search");
440444
out << indent(3) << "add <pkg>@<ver> Add dependency\n";
441445
out << indent(3) << "install Install dependencies\n";
442446
out << indent(3) << "update Update dependencies\n";
443-
out << indent(3) << "i Alias for install\n";
444-
out << indent(3) << "deps Legacy alias for install\n";
447+
out << indent(3) << "outdated Check available dependency updates\n";
445448
out << indent(3) << "remove <pkg> Remove dependency\n";
446449
out << indent(3) << "list List dependencies\n\n";
447450

451+
out << indent(2) << "Aliases:\n";
452+
out << indent(3) << "up Alias for update\n";
453+
out << indent(3) << "i Alias for install\n";
454+
out << indent(3) << "deps Legacy alias for install\n\n";
455+
448456
// Packaging
449457
out << indent(2) << "Build & share:\n";
450458
docs("https://vixcpp.com/docs/modules/cli/pack");
@@ -459,13 +467,13 @@ namespace vix
459467
out << indent(3) << "orm Database migrations\n";
460468
out << indent(3) << "p2p Run P2P node\n\n";
461469

462-
// Maintenance
470+
// System
463471
out << indent(2) << "System:\n";
464472
out << indent(3) << "doctor Check environment\n";
465473
out << indent(3) << "upgrade Update Vix\n";
466474
out << indent(3) << "uninstall Remove Vix\n\n";
467475

468-
// Info
476+
// Help
469477
out << indent(2) << "Help:\n";
470478
out << indent(3) << "help [command] Show command help\n";
471479
out << indent(3) << "version Show version\n\n";

src/commands/Dispatch.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <vix/cli/commands/UninstallCommand.hpp>
3939
#include <vix/cli/commands/UnpublishCommand.hpp>
4040
#include <vix/cli/commands/UpdateCommand.hpp>
41+
#include <vix/cli/commands/OutdatedCommand.hpp>
4142
#include <vix/cli/util/Ui.hpp>
4243

4344
#include <stdexcept>
@@ -213,6 +214,14 @@ namespace vix::cli::dispatch
213214
[]()
214215
{ return vix::commands::UpdateCommand::help(); }});
215216

217+
add({"outdated",
218+
"Registry",
219+
"Check which dependencies are behind the latest versions",
220+
[](const Args &a)
221+
{ return vix::commands::OutdatedCommand::run(a); },
222+
[]()
223+
{ return vix::commands::OutdatedCommand::help(); }});
224+
216225
add({"store",
217226
"Registry",
218227
"Manage local store cache (gc/path)",

0 commit comments

Comments
 (0)