juju / juju-crashdump

Script to assist in gathering logs and other debugging info from a Juju model
MIT License
10 stars 23 forks source link

Include some default values explicitly in the help output #73

Closed nobuto-m closed 3 years ago

nobuto-m commented 3 years ago

--max-file-size may cause an unexpected behavior from an user point of view since it doesn't collect larger files out of the box. It would be better to expose the default value explicitly in the help output so one can adjust it per their need.

nobuto-m commented 3 years ago

This will be the new output of the help fwiw.

usage: juju-crashdump [-h] [-d] [-m MODEL] [-f MAX_FILE_SIZE] [-b BUG]
                      [-x EXCLUDE] [-c COMPRESSION] [-o OUTPUT_DIR] [-u UNIQ]
                      [-s] [-a ADDON] [-t TIMEOUT] [--addons-file ADDONS_FILE]
                      [-j JOURNALCTL] [-l LOGGING_LEVEL]
                      [extra_dir [extra_dir ...]]

positional arguments:
  extra_dir             Extra directories to snapshot

optional arguments:
  -h, --help            show this help message and exit
  -d, --description     Output a short description of the plugin
  -m MODEL, --model MODEL
                        Model to act on
  -f MAX_FILE_SIZE, --max-file-size MAX_FILE_SIZE
                        The max file size (bytes) for included files.
                        (default: 5000000)
  -b BUG, --bug BUG     Upload crashdump to the given launchpad bug #
  -x EXCLUDE, --exclude EXCLUDE
                        Directories or files to exclude from capture.
  -c COMPRESSION, --compression COMPRESSION
                        The compression type to use for result tarball.
                        (default: xz)
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Store the completed crash dump in this dir.
  -u UNIQ, --uniq UNIQ  Unique id for this crashdump. We generate a uuid if
                        this is not specified.
  -s, --small           Make a 'small' crashdump, by skipping the contents of
                        /var/lib/juju.
  -a ADDON, --addon ADDON
                        Enable the addon with the given name
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout in seconds for creating unit tarballs.
                        (default: 45)
  --addons-file ADDONS_FILE
                        Use this file for addon definitions
  -j JOURNALCTL, --journalctl JOURNALCTL
                        Collect the journalctl logs for the systemd unit with
                        the given name
  -l LOGGING_LEVEL, --logging-level LOGGING_LEVEL
                        logging level (default: info)