Skip to content

Commit

Permalink
chore: update README with new flags
Browse files Browse the repository at this point in the history
Signed-off-by: Bradley Jones <bradley.jones@anchore.com>
  • Loading branch information
bradleyjones committed Apr 6, 2023
1 parent b3cc579 commit 0a4eea2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ Amazon Elastic Container Service (ECS).
command:

```
$ ./anchore-ecs-inventory --help
Anchore ECS Inventory can poll Amazon ECS (Elastic Container Service) APIs to tell Anchore which Images are currently in-use
$ anchore-ecs-inventory can poll Amazon ECS (Elastic Container Service) APIs to tell Anchore which Images are currently in-use
Usage:
anchore-ecs-inventory [flags]
anchore-ecs-inventory [command]
anchore-ecs-inventory [flags]
anchore-ecs-inventory [command]
Available Commands:
completion Generate Completion script
help Help about any command
version show the version
completion Generate Completion script
help Help about any command
version show the version
Flags:
-c, --config string application config file
-h, --help help for anchore-ecs-inventory
-p, --polling-interval-seconds string This specifies the polling interval of the ECS API in seconds (default "300")
-q, --quiet Suppresses inventory report output to stdout
-r, --region string If set overrides the AWS_REGION environment variable/region specified in the config file
-v, --verbose count increase verbosity (-v = info, -vv = debug)
Use "anchore-ecs-inventory [command] --help" for more information about a command
-c, --config string application config file
-d, --dry-run do not report inventory to Anchore
-h, --help help for anchore-ecs-inventory
-p, --polling-interval-seconds string this specifies the polling interval of the ECS API in seconds (default "300")
-q, --quiet suppresses inventory report output to stdout
-r, --region string if set overrides the AWS_REGION environment variable/region specified in anchore-ecs-inventory config
-v, --verbose count increase verbosity (-v = info, -vv = debug)
Use "anchore-ecs-inventory [command] --help" for more information about a command.
```

## Configuration
Expand Down
8 changes: 4 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,31 @@ var rootCmd = &cobra.Command{
func init() {
opt := "polling-interval-seconds"
rootCmd.Flags().
StringP(opt, "p", strconv.Itoa(config.DefaultConfigValues.PollingIntervalSeconds), "This specifies the polling interval of the ECS API in seconds")
StringP(opt, "p", strconv.Itoa(config.DefaultConfigValues.PollingIntervalSeconds), "this specifies the polling interval of the ECS API in seconds")
if err := viper.BindPFlag(opt, rootCmd.Flags().Lookup(opt)); err != nil {
fmt.Printf("unable to bind flag '%s': %+v", opt, err)
os.Exit(1)
}

opt = "region"
rootCmd.Flags().
StringP(opt, "r", config.DefaultConfigValues.Region, "If set overrides the AWS_REGION environment variable/region specified in anchore-ecs-inventory config")
StringP(opt, "r", config.DefaultConfigValues.Region, "if set overrides the AWS_REGION environment variable/region specified in anchore-ecs-inventory config")
if err := viper.BindPFlag(opt, rootCmd.Flags().Lookup(opt)); err != nil {
fmt.Printf("unable to bind flag '%s': %+v", opt, err)
os.Exit(1)
}

opt = "quiet"
rootCmd.Flags().
BoolP(opt, "q", config.DefaultConfigValues.Quiet, "Suppresses inventory report output to stdout")
BoolP(opt, "q", config.DefaultConfigValues.Quiet, "suppresses inventory report output to stdout")
if err := viper.BindPFlag(opt, rootCmd.Flags().Lookup(opt)); err != nil {
fmt.Printf("unable to bind flag '%s': %+v", opt, err)
os.Exit(1)
}

opt = "dry-run"
rootCmd.Flags().
BoolP(opt, "d", config.DefaultConfigValues.DryRun, "Do not report inventory to Anchore")
BoolP(opt, "d", config.DefaultConfigValues.DryRun, "do not report inventory to Anchore")
if err := viper.BindPFlag(opt, rootCmd.Flags().Lookup(opt)); err != nil {
fmt.Printf("unable to bind flag '%s': %+v", opt, err)
os.Exit(1)
Expand Down

0 comments on commit 0a4eea2

Please sign in to comment.