Use a CLI parsing library in Gitaly
Gitaly binary handled previously just launching the server. Nowadays, it has a check
subcommand which checks whether the Gitaly can call the internal API. It also will soon have subcommand to validate configuration and to set custom hooks. With &8903, more subcommands will be needed to join cluster nodes together, print debug information and more for general administration tasks.
Praefect is using a custom approach to parsing CLI and managing subcommands. This has turned eventually quite messy. There are a number of good libraries that handle setting up subcommands, parsing arguments and generating help texts. Rather than unnecessarily implementing our own CLI toolkit for Gitaly, we should use an existing library that gives us what we need.
One such library is https://cli.urfave.org/v2/getting-started/. It has a number of features that would make our life easier like subcommand hierarchies and help text generation. This makes it easier to provide consistent CLI experience with good help texts and less maintenance burdens.