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 #35

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

effigies
Copy link
Contributor

@effigies effigies commented Nov 4, 2024

Reopened from bids-standard/legacy-validator#2183.

Closes #11.

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)

@rwblair rwblair merged commit 4223800 into bids-standard:main Nov 7, 2024
13 checks passed
@effigies effigies deleted the feat/help-width branch November 7, 2024 22:56
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.

deno: --help should get either wrapped to 80 symbols or terminal width
2 participants