I get invalid argument error when running bitcoin-cli -getnetworkinfo, and a few other parameters
getinfo has been deprecated as an RPC command, and the hyphenated version is provided as a bridge for legacy applications that have not yet moved to getblockchaininfo and getnetworkinfo.

For regular RPC commands, you do not need the hyphen, and can simply run them as bitcoin-cli getblockchaininfo.

The hyphenated parameters control the behaviour of bitcoin-cli itself, such as which datadir to connect to, or whether to use named parameters in the requests.