Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 20, 2025

Problem

The add-items-to-project.sh script had hardcoded references to add-to-project.sh in its usage message, which was incorrect and confusing for users. The usage output showed the wrong script name regardless of how the script was actually named or called.

Solution

Replaced the hardcoded script name references with $(basename "$0") to dynamically display the actual script filename in the usage output.

Changes Made

  • Line 5: "Usage: add-to-project.sh ...""Usage: $(basename "$0") ..."
  • Line 7: "Example: add-to-project.sh ...""Example: $(basename "$0") ..."
  • Line 8: "Example: add-to-project.sh ...""Example: $(basename "$0") ..."

Before vs After

Before (hardcoded):

Usage: add-to-project.sh <org_or_user>/<project_number> <search_query>
Example: add-to-project.sh ekroon/1 1 is:open is:issue
Example: add-to-project.sh ekroon/1 1 is:open is:pr

After (dynamic):

Usage: add-items-to-project.sh <org_or_user>/<project_number> <search_query>
Example: add-items-to-project.sh ekroon/1 1 is:open is:issue
Example: add-items-to-project.sh ekroon/1 1 is:open is:pr

Benefits

  • ✅ Usage output now correctly shows the actual script filename
  • ✅ Works correctly when called with full path
  • ✅ Works correctly when called via symlink (shows symlink name)
  • ✅ More maintainable - no need to update usage if script is renamed
  • ✅ All other script functionality remains unchanged

This is a minimal, surgical change that improves user experience without affecting any core functionality.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Use script filename dynamically in usage instructions Fix hardcoded script name in usage output to use dynamic basename Jun 20, 2025
@Copilot Copilot AI requested a review from ekroon June 20, 2025 07:15
Copilot finished work on behalf of ekroon June 20, 2025 07:15
@ekroon ekroon marked this pull request as ready for review August 28, 2025 07:53
@ekroon ekroon merged commit 7f597e6 into main Aug 28, 2025
@ekroon ekroon deleted the copilot/fix-1e273938-de56-44a3-9f34-fd28b6867963 branch August 28, 2025 07:54
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