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

Make command line help easier to understand #968

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

SaschaWillems
Copy link
Collaborator

@SaschaWillems SaschaWillems commented Mar 8, 2024

Description

A common complaint, both here at github as well as social channels like Discord, is how to actually run our samples. You need to specify the name of a sample after an argument called sample. If you don't do that you get a huge list of all available options starting with an error text that's not easy to understand:

2024-03-08 17_35_11-V__Vulkan-KHR-Samples_Vulkan-Samples-Fork_build_windows_app_bin_debug_AMD64_vulk

Not only is this a lot of text that'll confuse people, but the actual command on how to run a sample is somewhere at the bottom of this.

This PR simplifies all of this, and if you now run the application without a sample or with a sample name that doesn't exist you get a proper help text that's much easier to understand:

2024-03-08 18_22_36-V__Vulkan-KHR-Samples_Vulkan-Samples-Fork_build_windows_app_bin_debug_AMD64_vulk

image

This message also tells people about the two other important arguments: getting a list of available samples and a list of all available command line arguments.

This should make it much easier to understand how to launch samples for new users.

Fixes #966

Tested on Windows 11 and Ubuntu 22.04 (via WSL2)

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

Add a new exit code when no sample is selcted or found
Only show a few hint lines with easy to understand help instead of full help
@SaschaWillems SaschaWillems added the framework This is relevant to the framework label Mar 8, 2024
Copy link
Collaborator

@tomadamatkinson tomadamatkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@gary-sweet gary-sweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very useful PR.

@marty-johnson59 marty-johnson59 merged commit d13cf6c into KhronosGroup:main Mar 11, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework This is relevant to the framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I am a beginner, emmmmm.
5 participants