Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Move init() to bottom of file
Browse files Browse the repository at this point in the history
  • Loading branch information
buzzsurfr committed Mar 7, 2020
1 parent e057b60 commit dfd0a3d
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions cmd/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,6 @@ func rotateFunc(cmd *cobra.Command, args []string) {
}
}

func init() {
rootCmd.AddCommand(rotateCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// rotateCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// rotateCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rotateCmd.Flags().StringVarP(&profileName, "profile", "p", "", "Profile to rotate")
}

// SessionUserName gets the user name of the current session
func SessionUserName(sess *session.Session) (string, error) {
var userName string
Expand Down Expand Up @@ -224,3 +209,18 @@ func SessionUserName(sess *session.Session) (string, error) {

return userName, nil
}

func init() {
rootCmd.AddCommand(rotateCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// rotateCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// rotateCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rotateCmd.Flags().StringVarP(&profileName, "profile", "p", "", "Profile to rotate")
}

0 comments on commit dfd0a3d

Please sign in to comment.