Running passes from plugins

I’m following this guide on writing an LLVM pass and in particular running the hello world pass: Writing an LLVM Pass — LLVM 16.0.0git documentation

When loading the LLVMHello.so library in opt and running it, opt says the ‘hello’ pass doesn’t exist:

./bin/opt -load ./lib/LLVMHello.so -hello input.ll -S
./bin/opt: unknown pass name 'hello'

Even though if I run --help, it shows the hello pass as an option:

./bin/opt -load ./lib/LLVMHello.so --help | grep -i hello
      --hello                                                              - Hello World Pass
      --hello2                                                             - Hello World Pass (with getAnalysisUsage implemented)

What am I doing wrong here?

Ah, just solved this, I needed to use the legacy pass manager with -enable-new-pm=0