Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help message when no arguments are provided #455

Merged
merged 1 commit into from
Jun 30, 2021
Merged

Conversation

wagoodman
Copy link
Contributor

Now when no arguments are provided, the default help text is displayed:

$ syft packages
Generate a packaged-based Software Bill Of Materials (SBOM) from container images and filesystems

Usage:
   packages [SOURCE] [flags]

...

an image/directory argument is required
exit status 1

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman added the bug Something isn't working label Jun 30, 2021
@wagoodman wagoodman requested a review from a team June 30, 2021 16:22
@wagoodman wagoodman self-assigned this Jun 30, 2021
@github-actions
Copy link

Benchmark Test Results

Benchmark results from the latest changes vs base branch
name                                                   old time/op    new time/op    delta
ImagePackageCatalogers/ruby-gemspec-cataloger-2           895µs ± 2%     997µs ± 2%  +11.34%  (p=0.008 n=5+5)
ImagePackageCatalogers/python-package-cataloger-2        1.24ms ± 5%    1.30ms ± 4%     ~     (p=0.095 n=5+5)
ImagePackageCatalogers/javascript-package-cataloger-2     457µs ± 3%     493µs ± 3%   +8.01%  (p=0.008 n=5+5)
ImagePackageCatalogers/dpkgdb-cataloger-2                 448µs ± 4%     471µs ± 1%   +5.18%  (p=0.008 n=5+5)
ImagePackageCatalogers/rpmdb-cataloger-2                  485µs ± 2%     501µs ± 2%   +3.15%  (p=0.016 n=5+5)
ImagePackageCatalogers/java-cataloger-2                  6.24ms ± 9%    6.50ms ± 3%     ~     (p=0.151 n=5+5)
ImagePackageCatalogers/apkdb-cataloger-2                  696µs ± 2%     717µs ± 2%   +2.94%  (p=0.032 n=5+5)
ImagePackageCatalogers/go-cataloger-2                     257µs ± 4%     258µs ± 4%     ~     (p=0.841 n=5+5)
ImagePackageCatalogers/rust-cataloger-2                   372µs ± 4%     393µs ± 3%   +5.60%  (p=0.016 n=5+5)

name                                                   old alloc/op   new alloc/op   delta
ImagePackageCatalogers/ruby-gemspec-cataloger-2          97.6kB ± 0%    97.6kB ± 0%     ~     (p=1.000 n=5+5)
ImagePackageCatalogers/python-package-cataloger-2         579kB ± 0%     579kB ± 0%     ~     (p=0.222 n=5+5)
ImagePackageCatalogers/javascript-package-cataloger-2     112kB ± 0%     112kB ± 0%   -0.10%  (p=0.008 n=5+5)
ImagePackageCatalogers/dpkgdb-cataloger-2                 116kB ± 0%     115kB ± 0%     ~     (p=0.222 n=5+5)
ImagePackageCatalogers/rpmdb-cataloger-2                  134kB ± 0%     134kB ± 0%   +0.01%  (p=0.008 n=5+5)
ImagePackageCatalogers/java-cataloger-2                  1.80MB ± 0%    1.79MB ± 0%   -0.21%  (p=0.008 n=5+5)
ImagePackageCatalogers/apkdb-cataloger-2                 1.14MB ± 0%    1.14MB ± 0%     ~     (p=0.817 n=5+5)
ImagePackageCatalogers/go-cataloger-2                    53.9kB ± 0%    53.8kB ± 0%   -0.24%  (p=0.008 n=5+5)
ImagePackageCatalogers/rust-cataloger-2                  88.9kB ± 0%    88.9kB ± 0%   +0.01%  (p=0.016 n=5+4)

name                                                   old allocs/op  new allocs/op  delta
ImagePackageCatalogers/ruby-gemspec-cataloger-2           1.96k ± 0%     1.96k ± 0%     ~     (all equal)
ImagePackageCatalogers/python-package-cataloger-2         5.89k ± 0%     5.89k ± 0%     ~     (all equal)
ImagePackageCatalogers/javascript-package-cataloger-2     1.93k ± 0%     1.93k ± 0%     ~     (all equal)
ImagePackageCatalogers/dpkgdb-cataloger-2                 2.37k ± 0%     2.37k ± 0%     ~     (all equal)
ImagePackageCatalogers/rpmdb-cataloger-2                  3.19k ± 0%     3.19k ± 0%     ~     (all equal)
ImagePackageCatalogers/java-cataloger-2                   22.3k ± 0%     22.3k ± 0%     ~     (all equal)
ImagePackageCatalogers/apkdb-cataloger-2                  1.85k ± 0%     1.85k ± 0%     ~     (p=0.444 n=5+5)
ImagePackageCatalogers/go-cataloger-2                     1.44k ± 0%     1.44k ± 0%     ~     (all equal)
ImagePackageCatalogers/rust-cataloger-2                   2.75k ± 0%     2.75k ± 0%     ~     (all equal)

Copy link
Contributor

@luhring luhring left a comment

Choose a reason for hiding this comment

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

Looks good! We can probably remove the extra lines of output after Use " [command] --help" ..., but that can be done later. Having the help text back is the high order bit here 🎉

image

@wagoodman wagoodman merged commit ecf4e55 into main Jun 30, 2021
@wagoodman wagoodman deleted the arg-help-message branch June 30, 2021 16:53
@wagoodman wagoodman linked an issue Jun 30, 2021 that may be closed by this pull request
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running syft without arguments doesn't display help text
3 participants