-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05a9790
commit 4c617f1
Showing
6 changed files
with
68 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func main() { | ||
s3Cleanup() | ||
var profile, region, bucket string | ||
var rootCmd = &cobra.Command{ | ||
Use: "s3-cleaner", | ||
Short: "A cli to clean and destroy s3 bucket", | ||
Long: `A cli to clean and destroy s3 bucket.`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
s3Cleanup(&profile, ®ion, &bucket) | ||
}, | ||
} | ||
|
||
rootCmd.PersistentFlags().StringVarP(&profile, "profile", "p", "", "AWS Profile (Required)") | ||
rootCmd.PersistentFlags().StringVarP(®ion, "region", "r", "", "AWS Region (Required)") | ||
rootCmd.PersistentFlags().StringVarP(&bucket, "bucket", "b", "", "AWS S3 bucket (Required)") | ||
rootCmd.MarkFlagsRequiredTogether("profile", "region", "bucket") | ||
|
||
rootCmd.Execute() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters