github.com/singularityware/singularity@v3.1.1+incompatible/docs/templates.go (about) 1 // Copyright (c) 2018, Sylabs Inc. All rights reserved. 2 // This software is licensed under a 3-clause BSD license. Please consult the 3 // LICENSE.md file distributed with the sources of this project regarding your 4 // rights to use or distribute this software. 5 6 package docs 7 8 // Global templates for help and usage strings 9 const ( 10 HelpTemplate string = `{{.Short}} 11 12 Usage: 13 {{.UseLine}} 14 15 Description:{{.Long}}{{if .HasAvailableLocalFlags}} 16 17 Options: 18 {{.LocalFlags.FlagUsagesWrapped 80 | trimTrailingWhitespaces}} 19 {{end}}{{if .HasAvailableInheritedFlags}} 20 21 Global Options: 22 {{.InheritedFlags.FlagUsagesWrapped 80 | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableSubCommands}} 23 Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} 24 {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasExample}} 25 26 Examples:{{.Example}}{{end}} 27 28 29 For additional help or support, please visit https://www.sylabs.io/docs/ 30 ` 31 32 UseTemplate string = `Usage: 33 {{TraverseParentsUses . | trimTrailingWhitespaces}}{{if .HasAvailableSubCommands}} <command> 34 35 Available Commands:{{range .Commands}}{{if .IsAvailableCommand}} 36 {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}} 37 ` 38 )