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

feat: Build help text based on console width #2183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

effigies
Copy link
Collaborator

Closes #2147.

Just pushing to have the record here. Can merge and use a fork of cliffy or wait for c4spar/deno-cliffy#761.

Before (regardless of terminal width):
❯ deno run -A jsr:@bids/validator --help

Usage:   bids-validator <dataset_directory>
Version: 1.14.13

Description:

  This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about
  Brain Imaging Data Structure visit http://bids.neuroimaging.io

Options:

  -h, --help                              - Show this help.
  -V, --version                           - Show the version number for this program.
  --json                                  - Output machine readable JSON
  -s, --schema           <URL-or-tag>     - Specify a schema version to use for validation
  -c, --config           <file>           - Path to a JSON configuration file
  -v, --verbose                           - Log more extensive information about issues
  --ignoreWarnings                        - Disregard non-critical issues
  --ignoreNiftiHeaders                    - Disregard NIfTI header content during validation
  --debug                <level>          - Enable debug output                                                             (Default: "ERROR", Values: "NOTSET", "DEBUG", "INFO",
                                                                                                                            "WARN", "ERROR", "CRITICAL")
  --filenameMode                          - Enable filename checks for newline separated filenames read from stdin
  --blacklistModalities  <modalities...>  - Array of modalities to error on if detected.                                    (Default: [], Values: "MRI", "PET", "MEG", "EEG", "iEEG",
                                                                                                                            "Microscopy", "NIRS", "MRS")
  -r, --recursive                         - Validate datasets found in derivatives directories in addition to root dataset
  -o, --outfile          <file>           - File to write validation results to.
  --color, --no-color    [color]          - Enable/disable color output (defaults to detected support)                      (Default: true)
After (88 columns)
❯ deno run -A ~/Projects/bids/bids-validator/bids-validator/src/bids-validator.ts --help

Usage:   bids-validator <dataset_directory>
Version: v1.14.15-dev.0-11-g8f3519b3

Description:

  This tool checks if a dataset in a given directory is compatible with the Brain
  Imaging Data Structure specification. To learn more about Brain Imaging Data
  Structure visit http://bids.neuroimaging.io

Options:

  -h, --help                              - Show this help.
  -V, --version                           - Show the version number
                                            for this program.
  --json                                  - Output machine readable
                                            JSON
  -s, --schema           <URL-or-tag>     - Specify a schema version
                                            to use for validation
  -c, --config           <file>           - Path to a JSON
                                            configuration file
  -v, --verbose                           - Log more extensive
                                            information about issues
  --ignoreWarnings                        - Disregard non-critical
                                            issues
  --ignoreNiftiHeaders                    - Disregard NIfTI header
                                            content during
                                            validation
  --debug                <level>          - Enable debug output       (Default:
                                                                      "ERROR", Values:
                                                                      "NOTSET",
                                                                      "DEBUG", "INFO",
                                                                      "WARN", "ERROR",
                                                                      "CRITICAL")
  --filenameMode                          - Enable filename checks
                                            for newline separated
                                            filenames read from
                                            stdin
  --blacklistModalities  <modalities...>  - Array of modalities to    (Default: [],
                                            error on if detected.     Values: "MRI",
                                                                      "PET", "MEG",
                                                                      "EEG", "iEEG",
                                                                      "Microscopy",
                                                                      "NIRS", "MRS")
  -r, --recursive                         - Validate datasets found
                                            in derivatives
                                            directories in addition
                                            to root dataset
  -o, --outfile          <file>           - File to write validation
                                            results to.
  --color, --no-color    [color]          - Enable/disable color      (Default: true)
                                            output (defaults to
                                            detected support)
142 columns
❯ deno run -A ~/Projects/bids/bids-validator/bids-validator/src/bids-validator.ts --help

Usage:   bids-validator <dataset_directory>
Version: v1.14.15-dev.0-11-g8f3519b3

Description:

  This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about
  Brain Imaging Data Structure visit http://bids.neuroimaging.io

Options:

  -h, --help                              - Show this help.
  -V, --version                           - Show the version number for this program.
  --json                                  - Output machine readable JSON
  -s, --schema           <URL-or-tag>     - Specify a schema version to use for validation
  -c, --config           <file>           - Path to a JSON configuration file
  -v, --verbose                           - Log more extensive information about issues
  --ignoreWarnings                        - Disregard non-critical issues
  --ignoreNiftiHeaders                    - Disregard NIfTI header content during validation
  --debug                <level>          - Enable debug output                                      (Default: "ERROR", Values: "NOTSET",
                                                                                                     "DEBUG", "INFO", "WARN", "ERROR",
                                                                                                     "CRITICAL")
  --filenameMode                          - Enable filename checks for newline separated filenames
                                            read from stdin
  --blacklistModalities  <modalities...>  - Array of modalities to error on if detected.             (Default: [], Values: "MRI", "PET",
                                                                                                     "MEG", "EEG", "iEEG", "Microscopy",
                                                                                                     "NIRS", "MRS")
  -r, --recursive                         - Validate datasets found in derivatives directories in
                                            addition to root dataset
  -o, --outfile          <file>           - File to write validation results to.
  --color, --no-color    [color]          - Enable/disable color output (defaults to detected        (Default: true)
                                            support)

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.48%. Comparing base (8f3519b) to head (3c48271).
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2183      +/-   ##
==========================================
+ Coverage   85.72%   87.48%   +1.75%     
==========================================
  Files          91      133      +42     
  Lines        3784     7056    +3272     
  Branches     1221     1671     +450     
==========================================
+ Hits         3244     6173    +2929     
- Misses        454      788     +334     
- Partials       86       95       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deno: --help should get either wrapped to 80 symbols or terminal width
1 participant