Files
fsh-oop/include/cmd/cmd_prompt.hpp
2025-07-29 15:33:17 +02:00

26 lines
590 B
C++

#pragma once
#include "cmd/cmd_base.hpp"
#include "util/stringliteral.hpp"
#include "fsh.hpp"
#include <string>
namespace fsh {
class CmdPrompt : public Command {
protected:
virtual void register_flags() override {
ArgFactory& factory = get_factory();
factory.add_rule<StringLiteral>(1);
}
virtual void run(std::istream& in, std::ostream& out, ArgManager& args) override {
std::string n_prompt = args.get<StringLiteral>(0).value();
fsh::instance().environment["PROMPT"] = n_prompt;
}
};
}