Commit f8f7ceb6 authored by williangaspar's avatar williangaspar

print message once

parent 840712bc
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
namespace bpftrace { namespace bpftrace {
namespace ast { namespace ast {
static bool PRINT_STACK_DEPRICATED = true;
class Visitor; class Visitor;
class Node { class Node {
...@@ -59,8 +61,12 @@ class Builtin : public Expression { ...@@ -59,8 +61,12 @@ class Builtin : public Expression {
public: public:
explicit Builtin(std::string ident) : ident(ident) { explicit Builtin(std::string ident) : ident(ident) {
if (ident == "stack") { if (ident == "stack") {
std::cout << "\033[33mwarning: \033[0m"; if (PRINT_STACK_DEPRICATED)
std::cout << "stack is deprecated and will be removed in the future. Use kstack instead" << std::endl; {
std::cerr << "warning: stack is deprecated and will be removed in the future. Use kstack instead" << std::endl;
PRINT_STACK_DEPRICATED = false;
}
this->ident = "kstack"; this->ident = "kstack";
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment