swift build --help used to have all(/most) the available options listed but currently only lists 6 options. The zsh completion (found at
/usr/share/zsh/5.8/functions/_swift) has more options but still missing some basic ones, like
I just checked and this regressed with Swift 5.5 last year, as 5.4.3 still showed them. A workaround is to run
swift package --help, which still shows all the build options. Also, the latest Apr. 4 trunk snapshot shows them with your command again.
yes this was indeed already fixed in main. will follow up to pull into a 5.6 update when possible.
for reference main line fix was merged in refactor CLI options by tomerd · Pull Request #4190 · apple/swift-package-manager · GitHub
will see if there is an opportunity to pull this into 5.6.x