Skip to content

Conversation

vnarapar
Copy link
Contributor

@vnarapar vnarapar commented Sep 7, 2025

This change provides greater flexibility by allowing users to provide specific parameters to individual testcases from run-test.sh

@vnarapar vnarapar requested a review from smuppand September 7, 2025 17:43
@vnarapar vnarapar force-pushed the main branch 3 times, most recently from 0e93439 to 139ae2f Compare September 7, 2025 19:24

if [ "$#" -eq 0 ]; then
log "Usage: $0 [all | <testcase_name>]"
echo "Usage:"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit/UX: Please refactor the usage/help output
Right now we mix lines with several echos and print “Usage” twice. For CLI UX (and tooling), help should be a single, clean block printed to stderr, with a -h/--help path and clear exit codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated as per comment to address clean block with help when -h/--help is given and added exit codes as suggested

@vnarapar vnarapar force-pushed the main branch 2 times, most recently from 510091c to 91c9ec0 Compare September 8, 2025 06:37
print_usage() {
cat >&2 <<EOF
Usage:
$0 all
Copy link
Contributor

Choose a reason for hiding this comment

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

$0 prints the script exactly as it was invoked, which might include a long/ugly path (e.g. .//run.sh or /tmp/x/y/run.sh). That clutters usage text and varies across environments.

"${0##*/}" strips any leading path and prints just the basename (e.g. run.sh).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

cat >&2 <<EOF
Usage:
$0 all
$0 <testcase_name> [arg1 arg2 ...]
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

This change provides greater flexibility by allowing users to provide
specific parameters to individual testcases from run-test.sh

Signed-off-by: Vamsee Narapareddi <[email protected]>
@smuppand smuppand merged commit 2f6e1aa into qualcomm-linux:main Sep 9, 2025
8 checks passed
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.

2 participants