Skip to content

Commit

Permalink
Fixed typo in user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanPino committed Feb 20, 2024
1 parent 0967a36 commit 6390763
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/content/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ If your command has multiple required flags that are not [grouped](#flag-groups)
when one or more flags have not been set, mark them as required:
```go
rootCmd.Flags().StringVarP(&Region, "region", "r", "", "AWS region (required)")
rootCmd.Flags().StringVarP(&Region, "failoverRegion", "f", "", "AWS failover region (required)")
rootCmd.MarkFlagsRequired("region", "failoverRegion")
rootCmd.Flags().StringVarP(&Failover, "failover", "f", "", "AWS failover region (required)")
rootCmd.MarkFlagsRequired("region", "failover")
```

Or, for multiple persistent flags:
```go
rootCmd.PersistentFlags().StringVarP(&Region, "region", "r", "", "AWS region (required)")
rootCmd.PersistentFlags().StringVarP(&Region, "failoverRegion", "f", "", "AWS failover region (required)")
rootCmd.MarkPersistentFlagsRequired("region", "failoverRegion")
rootCmd.PersistentFlags().StringVarP(&Failover, "failover", "f", "", "AWS failover region (required)")
rootCmd.MarkPersistentFlagsRequired("region", "failover")
```


Expand Down

0 comments on commit 6390763

Please sign in to comment.