docs(cli): introduce examples in the kompose command

Signed-off-by: Martin Jirku <martin@jirku.sk>
This commit is contained in:
Martin Jirku 2024-01-17 21:42:48 +01:00
parent 770da91eec
commit ae975a818d
No known key found for this signature in database
GPG Key ID: B7476C9B46DDFD25
2 changed files with 7 additions and 0 deletions

View File

@ -79,6 +79,9 @@ var (
var convertCmd = &cobra.Command{ var convertCmd = &cobra.Command{
Use: "convert", Use: "convert",
Short: "Convert a Docker Compose file", Short: "Convert a Docker Compose file",
Example: ` kompose --file docker-voting.yml convert
kompose -f docker-compose.yml -f docker-guestbook.yml convert
kompose --provider openshift --file docker-voting.yml convert`,
PreRun: func(cmd *cobra.Command, args []string) { PreRun: func(cmd *cobra.Command, args []string) {
// Check that build-config wasn't passed in with --provider=kubernetes // Check that build-config wasn't passed in with --provider=kubernetes

View File

@ -53,6 +53,10 @@ var RootCmd = &cobra.Command{
Use: "kompose", Use: "kompose",
Short: "A tool helping Docker Compose users move to Kubernetes", Short: "A tool helping Docker Compose users move to Kubernetes",
Long: `Kompose is a tool to help users who are familiar with docker-compose move to Kubernetes.`, Long: `Kompose is a tool to help users who are familiar with docker-compose move to Kubernetes.`,
Example: ` kompose --file docker-voting.yml convert
kompose -f docker-compose.yml -f docker-guestbook.yml convert
kompose --provider openshift --file docker-voting.yml convert
kompose completion bash`,
SilenceErrors: true, SilenceErrors: true,
// PersistentPreRun will be "inherited" by all children and ran before *every* command unless // PersistentPreRun will be "inherited" by all children and ran before *every* command unless
// the child has overridden the functionality. This functionality was implemented to check / modify // the child has overridden the functionality. This functionality was implemented to check / modify