airshipctl/docs/tools/generate_cli_docs.go
Ruslan Aliev abd1317566 Refactor airshipctl root command
As part of config refactoring process, we have to prepare root
level command to future changes, optimize function signatures
and its logic.

Change-Id: I563a7556ce1cca795a74cf2c6a26380467a15a5d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-08-25 17:37:19 -05:00

37 lines
905 B
Go

/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
"os"
"github.com/spf13/cobra/doc"
"opendev.org/airship/airshipctl/cmd"
)
func main() {
rootCmd := cmd.NewAirshipCTLCommand(os.Stdout)
// Remote auto-generated notice
rootCmd.DisableAutoGenTag = true
if err := doc.GenMarkdownTree(rootCmd, "./docs/source/cli"); err != nil {
fmt.Fprintln(os.Stdout, err)
os.Exit(1)
}
}