Skip to content

Use a CLI framework in Gitaly

Sami Hiltunen requested to merge smh-cli-framework into master

Gitaly's Main is currently a bit of a mess with CLI parsing logic mixed with other code. There's no real support for adding properly subcommands or generating automatically help texts. This commit introduces urfave/cli as the framework of choice in Gitaly to structure the CLI interfaces. This gives all of the features we need out of the box so we don't have to implement them ourselves.

Backwards compatibility is maintained with successful invocations of the Gitaly resulting in launching the check subcommand, -version printing or launching the main server daemon. Erroring invocations are not guaranteed to be backwards compatible, as the help text is different and in some cases the exit code as well. This should generally be fine as it's unlikely anyone would be relying on failing invocations in scripts other than tests.

Closes #4819 (closed)

Edited by Sami Hiltunen

Merge request reports