diff --git a/README.md b/README.md index 74cf522..b12bff5 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ By default ports 1-1023 are privileged ports that only the root user can bind. W An example of a wrong instruction that the tool would detect is ``` -EXPOSE 8080 +EXPOSE 80 ``` with this printed message @@ -92,7 +92,7 @@ To build and use the cli, execute ``` go build -o doa[.exe] -doa[.exe] analyze /your/local/project/path[/Dockerfile_name] +doa[.exe] analyze -f /your/local/project/path[/Dockerfile_name] ``` Contributing diff --git a/pkg/cli/analyze.go b/pkg/cli/analyze.go index cae9ac6..ba85932 100644 --- a/pkg/cli/analyze.go +++ b/pkg/cli/analyze.go @@ -18,28 +18,28 @@ func NewCmdAnalyze() *cobra.Command { Run: doAnalyze, Example: ` doa analyze -f /your/local/project/path[/Dockerfile_name]`, } - analyzeCmd.PersistentFlags().String( - "f", "", "Container file to analyze", + analyzeCmd.PersistentFlags().StringP( + "file", "f", "", "Container file to analyze", ) - analyzeCmd.PersistentFlags().String( - "i", "", "Image name to analyze", + analyzeCmd.PersistentFlags().StringP( + "image", "i", "", "Image name to analyze", ) - analyzeCmd.PersistentFlags().String( - "o", "", "Specify output format, supported format: json", + analyzeCmd.PersistentFlags().StringP( + "output", "o", "", "Specify output format, supported format: json", ) return analyzeCmd } func doAnalyze(cmd *cobra.Command, args []string) { - containerfile := cmd.Flag("f") - image := cmd.Flag("i") + containerfile := cmd.Flag("file") + image := cmd.Flag("image") if containerfile.Value.String() == "" && image.Value.String() == "" { PrintNoArgsWarningMessage(cmd.Name()) return } outputFunc := PrintPrettifyOutput - out := cmd.Flag("o") + out := cmd.Flag("output") if out.Value.String() != "" && !strings.EqualFold(out.Value.String(), "json") { RedirectErrorStringToStdErrAndExit(fmt.Sprintf("unknown value '%s' for flag %s, type --help for a list of all flags\n", out.Value.String(), out.Name)) } else if strings.EqualFold(out.Value.String(), "json") {