December 2021
Intermediate to advanced
510 pages
11h 20m
English
Two features that improve your user experience are command completion and documentation. Command completion guides the user by providing contextual suggestions when they press the TAB key. Documentation instructs users by providing additional information, context, and examples about using the application.
Let’s add two new subcommands to your tool allowing the users to generate command completion and documentation for it. Start with the command completion subcommand completion. Use the Cobra generator again to add this subcommand to your application:
| | $ cobra add completion |
| | Using config file: /home/ricardo/.cobra.yaml |
| | completion created at /home/ricardo/pragprog.com/rggo/cobra/pScan ... |
Read now
Unlock full access