Argument to optimization pass

Is it possible to pass a command-line argument to my own optimization
pass?

Yes. Look at the Loop-Unrolling pass and see how the unroll-thresholds is passed. You can also read the LLVM docs, the section about the command-line library.