Skip to content

Commit 1c00205

Browse files
jimpdxcwarden
authored andcommitted
Add Version to RootCmd
Set the Cobra command's Version field (Version: version) on RootCmd so the CLI can report its version (e.g., via --version). Also adjust field alignment/spacing in the command struct.
1 parent 900e218 commit 1c00205

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cmd/root.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ func init() {
2929
}
3030

3131
var RootCmd = &cobra.Command{
32-
Use: "apexfmt [file...]",
33-
Short: "Format Apex",
32+
Use: "apexfmt [file...]",
33+
Short: "Format Apex",
34+
Version: version,
3435
RunE: func(cmd *cobra.Command, args []string) error {
3536
if soql, _ := cmd.Flags().GetBool("soql"); soql {
3637
formatSOQL()

0 commit comments

Comments
 (0)