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

--help: List available analyzers, improve Usage line #303

Merged
merged 1 commit into from
May 13, 2019

Conversation

cben
Copy link
Contributor

@cben cben commented Mar 5, 2019

Closes #293.
Added list of values to help for --type flag.
Also noticed Usage: lines in help diff / help analyze didn't mention required image args, added them.

before/after diffs:

container-diff help analyze

-Analyzes an image using the specifed analyzers as indicated via flags (see documentation for available ones).
+Analyzes an image using the specifed analyzers as indicated via --type flag(s).
+
+For details on how to specify images, run: container-diff help
 
 Usage:
-  container-diff analyze [flags]
+  container-diff analyze image [flags]
 
 Flags:
   -c, --cache-dir string   cache directory base to create .container-diff (default is $HOME).
       --force              force overwrite output file, if exists already.
   -h, --help               help for analyze
   -j, --json               JSON Output defines if the diff should be returned in a human readable format (false) or a JSON (true).
   -n, --no-cache           Set this to force retrieval of image filesystem on each run.
   -o, --order              Set this flag to sort any file/package results by descending size. Otherwise, they will be sorted by name.
   -w, --output string      output file to write to (default writes to the screen).
   -q, --quiet              Suppress output to stderr.
   -s, --save               Set this flag to save rather than remove the final image filesystems on exit.
-  -t, --type Diff Types    This flag sets the list of analyzer types to use. Set it repeatedly to use multiple analyzers.
+  -t, --type Diff Types    This flag sets the list of analyzer types to use.
+                           Set it repeatedly to use multiple analyzers.
+                           Supported types: apt, aptlayer, file, history, layer, metadata, node, pip, rpm, rpmlayer, size, sizelayer.
 
 Global Flags:
       --format string      Format to output diff in.
   -v, --verbosity string   This flag controls the verbosity of container-diff. (default "warning")

container-diff help diff

-Compares two images using the specifed analyzers as indicated via flags (see documentation for available ones).
+Compares two images using the specifed analyzers as indicated via --type flag(s).
+
+For details on how to specify images, run: container-diff help
 
 Usage:
-  container-diff diff [flags]
+  container-diff diff image1 image2 [flags]
 
 Flags:
   -c, --cache-dir string   cache directory base to create .container-diff (default is $HOME).
   -f, --filename string    Set this flag to the path of a file in both containers to view the diff of the file. Must be used with --types=file flag.
       --force              force overwrite output file, if exists already.
   -h, --help               help for diff
   -j, --json               JSON Output defines if the diff should be returned in a human readable format (false) or a JSON (true).
   -n, --no-cache           Set this to force retrieval of image filesystem on each run.
   -o, --order              Set this flag to sort any file/package results by descending size. Otherwise, they will be sorted by name.
   -w, --output string      output file to write to (default writes to the screen).
   -q, --quiet              Suppress output to stderr.
   -s, --save               Set this flag to save rather than remove the final image filesystems on exit.
-  -t, --type Diff Types    This flag sets the list of analyzer types to use. Set it repeatedly to use multiple analyzers.
+  -t, --type Diff Types    This flag sets the list of analyzer types to use.
+                           Set it repeatedly to use multiple analyzers.
+                           Supported types: apt, aptlayer, file, history, layer, metadata, node, pip, rpm, rpmlayer, size, sizelayer.
 
 Global Flags:
       --format string      Format to output diff in.
   -v, --verbosity string   This flag controls the verbosity of container-diff. (default "warning")

container-diff help

 container-diff is a CLI tool for analyzing and comparing container images.
 
 Images can be specified from either a local Docker daemon, or from a remote registry.
 To specify a local image, prefix the image ID with 'daemon://', e.g. 'daemon://gcr.io/foo/bar'.
 To specify a remote image, prefix the image ID with 'remote://', e.g. 'remote://gcr.io/foo/bar'.
 If no prefix is specified, the local daemon will be checked first.
 
 Tarballs can also be specified by simply providing the path to the .tar, .tar.gz, or .tgz file.
 
 Usage:
   container-diff [command]
 
 Available Commands:
-  analyze     Analyzes an image: [image]
-  diff        Compare two images: [image1] [image2]
+  analyze     Analyzes an image: container-diff image
+  diff        Compare two images: container-diff image1 image2
   help        Help about any command
   version     Print the version of container-diff
 
 Flags:
       --format string      Format to output diff in.
   -h, --help               help for container-diff
   -v, --verbosity string   This flag controls the verbosity of container-diff. (default "warning")
 
 Use "container-diff [command] --help" for more information about a command.

Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cben thanks for the PR! looks like you forgot the subcommands in the short descriptions, other than that LGTM.

cmd/analyze.go Show resolved Hide resolved
cmd/diff.go Show resolved Hide resolved
@donmccasland donmccasland self-requested a review May 13, 2019 22:06
@donmccasland donmccasland merged commit b09893a into GoogleContainerTools:master May 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI help should list available differ types
3 participants