예제 #1
0
        private int?HandleVersionOption(CommandInput commandInput)
        {
            // Version should be rendered if it was requested on a default command
            var shouldRenderVersion = !commandInput.IsCommandSpecified() && commandInput.IsVersionOptionSpecified();

            // If shouldn't render version, pass execution to the next handler
            if (!shouldRenderVersion)
            {
                return(null);
            }

            // Render version text
            _console.Output.WriteLine(_metadata.VersionText);

            // Short-circuit with exit code 0
            return(0);
        }