Task: Build a small CLI wrapper in /app/ named nuget-delete that deletes a specific version of the NuGet package rm.Threading using the NuGet CLI.
What to implement:
A POSIX-compliant shell executable (script) named nuget-delete placed in /app/.
It should support:
A required positional argument VERSION (the NuGet package version to delete).
A help/usage conduit via -h (optional): when invoked with -h, print the script’s header comments as usage information and exit gracefully.
If VERSION is not provided, print exactly the error: fatal: version required to standard error, then print the usage information and exit with status 1.
When a VERSION is provided, perform the delete operation by invoking:
The API key for NuGet is read from the file at ~/dump/.nuget.apikey.
The script should emit the usual command output (stdout/stderr) from the dotnet call, and exit with the same exit code as the dotnet invocation.
Inputs and outputs:
Input: A single version string passed as the first argument (e.g., 1.2.3).
Output: The dotnet nuget delete command’s stdout/stderr output; exit code mirrors the delete command. If called without a version, prints the exact error message to stderr and usage info, and exits with code 1.
File locations and naming:
Solution file: /app/nuget-delete
Make the script executable (e.g., chmod +x /app/nuget-delete)
Notes:
Do not reveal test logic in the task description.
The header/usage information should be present in the script as comments so that a helper like print-file-comments "$0" can display it when needed.