#pragma once #include #include #include #include #include "breeze/Version.hpp" /// The CLI managing itself: which versions of it are installed, which one is picked, and running /// the picked one. Versions live in /cli//; `cli/current` names the picked /// one, and /bin/breeze is the copy to put on PATH. Whatever `breeze` the shell finds /// hands the command to the picked version, so installing or picking never means changing PATH /// again. namespace breeze::self { /// The version of this program. std::string version(); /// Installed versions, oldest first. std::vector installed(); /// The version `cli pick` chose, if any. std::optional picked(); /// Installs a version: this very program if that is its version, else a release of the /// configured CLI source. The first version installed is picked. void install(const std::string& version); void pick(const std::string& version); /// Removes a version; un-picks it if it was the picked one. void uninstall(const std::string& version); /// Prints the installed versions, marking the picked one and the running one. void list(); /// If another version is picked, installed and runnable, runs it with `args` and does not /// return. `cli ...` commands always run in the version that was started. void forwardToPicked(const std::vector& args); }