This commit is contained in:
parent
0ecef19936
commit
d557ab01f7
@ -415,12 +415,58 @@ int uninstall_tool(int argc, char* argv[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_help() {
|
||||
std::cout << "getpkg - Package manager for dropshell tools" << std::endl;
|
||||
std::cout << "Version: " << dropshell::VERSION << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "USAGE:" << std::endl;
|
||||
std::cout << " getpkg <tool_name> Install/update the specified tool" << std::endl;
|
||||
std::cout << " getpkg <command> [args...] Run a specific command" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "COMMANDS:" << std::endl;
|
||||
std::cout << " install <tool_name> Install or update a tool" << std::endl;
|
||||
std::cout << " Downloads and installs the tool from getpkg.xyz" << std::endl;
|
||||
std::cout << " Updates if a newer version is available" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << " uninstall <tool_name> Remove an installed tool" << std::endl;
|
||||
std::cout << " Removes tool files, PATH entries, and autocomplete" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << " publish <tool_name[:ARCH]> <folder> Upload a tool to getpkg.xyz" << std::endl;
|
||||
std::cout << " ARCH is optional (defaults to 'universal')" << std::endl;
|
||||
std::cout << " Requires SOS_WRITE_TOKEN environment variable" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << " update Update getpkg and all installed tools" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << " create <tool_name> <directory> Create a new tool project" << std::endl;
|
||||
std::cout << " Creates directory structure and setup script" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << " version Show getpkg version" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << " help Show this help message" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "EXAMPLES:" << std::endl;
|
||||
std::cout << " getpkg ripgrep Install ripgrep tool" << std::endl;
|
||||
std::cout << " getpkg install myapp Install myapp (legacy syntax)" << std::endl;
|
||||
std::cout << " getpkg publish myapp:x86_64 ./build Publish architecture-specific build" << std::endl;
|
||||
std::cout << " getpkg publish myapp ./build Publish universal build" << std::endl;
|
||||
std::cout << " getpkg uninstall myapp Remove myapp from system" << std::endl;
|
||||
std::cout << " getpkg update Update everything" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "ENVIRONMENT:" << std::endl;
|
||||
std::cout << " SOS_WRITE_TOKEN Auth token for publishing tools" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "FILES:" << std::endl;
|
||||
std::cout << " ~/.bashrc_getpkg Tool PATH and autocomplete setup" << std::endl;
|
||||
std::cout << " ~/.config/getpkg/ Tool metadata and configs" << std::endl;
|
||||
std::cout << " ~/.local/bin/getpkg/ Installed tool binaries" << std::endl;
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc < 2) {
|
||||
std::cout << "Usage: getpkg <tool_name> | <command> [args...]" << std::endl;
|
||||
return 1;
|
||||
show_help();
|
||||
return 0;
|
||||
}
|
||||
std::string command = argv[1];
|
||||
if (command == "install") {
|
||||
@ -446,15 +492,7 @@ help
|
||||
} else if (command == "create") {
|
||||
return create_tool(argc, argv);
|
||||
} else if (command == "help") {
|
||||
std::cout << "Usage: getpkg <tool_name> | <command> [args...]" << std::endl;
|
||||
std::cout << "Commands:" << std::endl;
|
||||
std::cout << " <tool_name> Install/update the specified tool" << std::endl;
|
||||
std::cout << " install <tool_name> Install/update tool (legacy)" << std::endl;
|
||||
std::cout << " uninstall <tool_name> Uninstall the specified tool" << std::endl;
|
||||
std::cout << " publish <tool_name[:ARCH]> <folder> Publish a tool (ARCH optional)" << std::endl;
|
||||
std::cout << " update Update getpkg and all tools" << std::endl;
|
||||
std::cout << " version Show getpkg version" << std::endl;
|
||||
std::cout << " create <tool_name> <directory> Create new tool directory" << std::endl;
|
||||
show_help();
|
||||
} else {
|
||||
// Assume it's a tool name and install it
|
||||
char* fakeArgv[] = {argv[0], (char*)"install", argv[1]};
|
||||
|
Loading…
x
Reference in New Issue
Block a user