how to differentiate bitcoin-cli command when have testnet & mainnet both running I have bitcoin testnet3, mainnet, regtest both running in the same server, I can interactive with them by curl, because the ports are different, but when comes to bitcoin-cli how can I specific the network I want interactive with?

I get below error:

$ bitcoin-cli -regtest setgenerate true 101  # I want use regtest
Error: Invalid combination of -regtest and -testnet.
You can pass the -rpcport flag to bitcoin-cli to specify which node to connect to when running multiple on the same machine.