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

Refine commandline help messages #95

Merged
merged 3 commits into from
Jul 13, 2022
Merged

Conversation

jiangliu
Copy link
Contributor

Refine commandline help messages.

Signed-off-by: Jiang Liu gerry@linux.alibaba.com

root@91435c1ca697:/nydus# bin/containerd-nydus-grpc -h
NAME:
   containerd-nydus-grpc - Nydus remote snapshotter for containerd

USAGE:
   containerd-nydus-grpc [global options] command [command options] [arguments...]

VERSION:
   da88d96

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --address PATH                               set PATH for gRPC socket (default: "/run/containerd-nydus/containerd-nydus-grpc.sock")
   --cache-dir DIRECTORY, -C DIRECTORY          set DIRECTORY to store/cache downloaded image data
   --cleanup-on-close                           whether to clean up on exit (default: false)
   --config-path FILE, -c FILE, --config FILE   path to the configuration FILE
   --convert-vpc-registry                       whether to automatically convert the image to vpc registry to accelerate image pulling (default: false)
   --daemon-mode MODE, -M MODE                  set daemon working MODE, one of "multiple", "shared" or "none" (default: "multiple")
   --disable-cache-manager                      whether to disable blob cache manager (default: false)
   --enable-metrics                             whether to collect metrics (default: false)
   --enable-nydus-overlayfs                     whether to enable nydus-overlayfs (default: false)
   --enable-stargz                              whether to enable support of estargz image (experimental) (default: false)
   --fs-driver DRIVER, --daemon-backend DRIVER  backend DRIVER to serve the filesystem, one of "fusedev", "fscache" (default: "fusedev")
   --gc-period INTERVAL                         blob cache garbage collection INTERVAL, duration string(for example, 1m, 2h) (default: "24h")
   --log-dir DIRECTORY, -L DIRECTORY            set DIRECTORY to store log files
   --log-level LEVEL, -l LEVEL                  set the logging LEVEL [trace, debug, info, warn, error, fatal, panic] (default: "info")
   --log-to-stdout                              log messages to standard out rather than files. (default: false)
   --metrics-file FILE                          path to the metrics output FILE
   --nydus-image PATH, --nydusimg-path PATH     set PATH to the nydus-image binary, default to lookup nydus-image in $PATH
   --nydusd PATH, --nydusd-path PATH            set PATH to the nydusd binary, default to lookup nydusd in $PATH
   --nydusd-thread-num value                    set worker thread number for nydusd, default to the number of CPUs (default: 0)
   --publickey-file FILE                        path to the publickey FILE for signature validation (default: "/signing/nydus-image-signing-public.key")
   --root DIRECTORY, -R DIRECTORY               set DIRECTORY to store snapshotter working state (default: "/var/lib/containerd-nydus-grpc")
   --shared-daemon                              Deprecated, equivalent to "--daemon-mode shared" (default: false)
   --sync-remove                                whether to clean up snapshots in synchronous mode, default to asynchronous mode (default: false)
   --validate-signature                         whether to validate integrity of image bootstrap (default: false)
   --help, -h                                   show help (default: false)
   --version, -v                                print the version (default: false)

Refine commandline help messages.

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
@codecov-commenter
Copy link

Codecov Report

Merging #95 (da88d96) into main (542d7e7) will increase coverage by 0.18%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   28.66%   28.85%   +0.18%     
==========================================
  Files          17       17              
  Lines        1528     1532       +4     
==========================================
+ Hits          438      442       +4     
  Misses       1026     1026              
  Partials       64       64              
Impacted Files Coverage Δ
cmd/containerd-nydus-grpc/pkg/command/flags.go 78.19% <100.00%> (+0.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 542d7e7...da88d96. Read the comment docs.

Enhance the way to validate commandline arguments:
1) handle `shared-daemon` before validating `fscache`
2) ensure `root` is not empty

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
Beatify the error message a bit.

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

LGTM!

@imeoer imeoer merged commit 55ec5f8 into containerd:main Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants