Open brian-ruf opened 1 week ago
The current output oscal-cli validate [<options>] <file-or-URI-to-validate>
is intentional and consistent across all commands. The current approach mirrors what is a common pattern in most *nix commands, for which the CLI was modeled after.
For example, apt
:
Usage: apt [options] command
Or grep
:
Usage: grep [OPTION]... PATTERNS [FILE]...
A somewhat counter example with before and after, git
:
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
[--config-env=<name>=<envvar>] <command> [<args>]
In reality, options can come before or after the extra arguments, so you can make an argument that either or both are correct.
Given that this is a stylistic issue that is subject to personal taste, it would be informative to see if others weight in on this change before making any adjustments. For now, its probably best to leave it as-is.
Describe the bug
The help output from
oscal-cli
for validate incorrectly shows the options before the source file.Who is the bug affecting
Users attempting to validate content, using the help output from
oscal-cli
How do we replicate this issue
oscal-cli validate --help
(or attempt to use the validate command without correct input)usage: oscal-cli validate [<options>] <file-or-URI-to-validate>
Shows
[<options>]
beforefile-or-URI-to-validate
Expected behavior (i.e. solution)
This should present:
usage: oscal-cli validate <file-or-URI-to-validate> [<options>]
Other comments
The syntax here is correct: [usage: oscal-cli validate [] ](usage: oscal-cli validate [] )