Skip to content

Commit

Permalink
Merge branch 'fix/options'
Browse files Browse the repository at this point in the history
  • Loading branch information
youyo committed Feb 8, 2022
2 parents 5e50682 + 136ddd4 commit c4d24ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions _awssh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ _awssh() {
'(-p --port)'{-p,--port}'[ssh login port.]' \
'--cache[enable cache a credentials.]' \
'--duration[cache duration.]' \
'--enable-snapshot[enable snapshot.]' \
'(-c --external-command)'{-c,--external-command}'[feature use.]' \
'(-i --identity-file)'{-i,--identity-file}'[identity file path.]' \
'--profile[use a specific profile from your credential file.]' \
'(-P --publickey)'{-P,--publickey}'[public key file path.]' \
'--select-profile[select a specific profile from your credential file.]' \
'--version[version for awssh]' \
'--completion-zsh[output shell completion code for the zsh.]'
'--select-profile[select a specific profile from your credential file.]'
}
2 changes: 1 addition & 1 deletion awssh/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func init() {
rootCmd.Flags().Bool("select-profile", false, "select a specific profile from your credential file.")
rootCmd.Flags().Bool("cache", false, "enable cache a credentials.")
rootCmd.Flags().String("duration", "1 hour", "cache duration.")
rootCmd.Flags().Bool("disable-snapshot", false, "disable snapshot.")
rootCmd.Flags().Bool("enable-snapshot", false, "enable snapshot.")

viper.BindPFlags(rootCmd.Flags())
}
Expand Down
4 changes: 2 additions & 2 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Run(cmd *cobra.Command, args []string) (err error) {

profile := viper.GetString("profile")
cache := viper.GetBool("cache")
disableSnapshot := viper.GetBool("disable-snapshot")
enableSnapshot := viper.GetBool("enable-snapshot")
duration, err := duration.Parse(viper.GetString("duration"))
if err != nil {
return err
Expand All @@ -46,7 +46,7 @@ func Run(cmd *cobra.Command, args []string) (err error) {
}

// Get snapshot
if disableSnapshot != true {
if enableSnapshot == true {
go func() {
if imageId, err := createAMI(ctx, awsSession, instanceID); err != nil {
fmt.Printf("Failed to create to auto snapshot. error: %T\n", err)
Expand Down

0 comments on commit c4d24ff

Please sign in to comment.