There is no API to do this. You have to split off the port number yourself.
Also see this answer, which mentions that most utilities use a -p port
argument instead of :port
to specify the port.
If you really want something like this, it would probably be trivial to just write it yourself.