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

Help Output is Incorrect for Validate #80

Open
brian-ruf opened this issue Nov 22, 2024 · 2 comments
Open

Help Output is Incorrect for Validate #80

brian-ruf opened this issue Nov 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@brian-ruf
Copy link

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

  1. Run oscal-cli validate --help (or attempt to use the validate command without correct input)
  2. Observe first line of output: usage: oscal-cli validate [<options>] <file-or-URI-to-validate>

Shows [<options>] before file-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 [] )

@brian-ruf brian-ruf added the bug Something isn't working label Nov 22, 2024
@brian-ruf brian-ruf changed the title Correct help output Help Output is Incorrect for Validate Nov 22, 2024
@david-waltermire david-waltermire moved this from To Triage to Ready in Spec and Tooling Work Board Nov 22, 2024
@david-waltermire david-waltermire self-assigned this Nov 22, 2024
@david-waltermire
Copy link
Contributor

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.

@david-waltermire david-waltermire moved this from Ready to Backlog in Spec and Tooling Work Board Nov 26, 2024
@david-waltermire david-waltermire added the question Further information is requested label Nov 26, 2024
@david-waltermire
Copy link
Contributor

There hasn't been any additional feedback on this issue for the last two weeks. We'll give this another week for feedback before closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Status: Backlog
Development

No branches or pull requests

2 participants