Skip to content

Conversation

@flydev-fr
Copy link
Contributor

Description

Overview

This PR improves the handling of the --src argument for the new command in wire-cli, addressing cross-platform compatibility, user experience, and documentation clarity.

Key Improvements

  • Robust Path Handling

    • Normalizes slashes for Windows, Linux, and macOS compatibility.
    • Handles paths with spaces and quotes gracefully.
    • Uses canonicalization to resolve relative paths and symbolic links.
    • Provides clear, actionable error messages if the path does not exist or is not accessible.
  • User Experience

    • If a user provides an invalid or non-existent path, the CLI now outputs a clear error message explaining the issue and how to resolve it.
    • The CLI never writes to the --src directory; it only reads from it and copies/extracts to the target directory.
  • Documentation

    • Updates to README.md and docs/commands/common.md to clarify:
      • How to use the --src argument with both relative and absolute paths.
      • How to handle paths with spaces and different slash types.
      • That --src is a source (input), not a destination (output).
      • Example usage and troubleshooting tips.
  • Testing

    • Adds and fixes tests for:
      • Relative and absolute --src paths.
      • Paths with mixed slashes and spaces.
      • Non-existent paths (ensuring proper error handling).

How to Test

  • Use both relative and absolute paths for --src.
  • Try paths with spaces, quotes, and both / and \\ slashes.
  • Try a non-existent path to verify the improved error message.
  • Confirm that the CLI copies/extracts from the --src location to the target directory, never the other way around.

References

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ BugBot reviewed your changes and found no bugs!


Was this report helpful? Give feedback by reacting with 👍 or 👎

@flydev-fr flydev-fr merged commit af3fe6f into main Jun 9, 2025
@flydev-fr flydev-fr deleted the fix/cli-src-path-handling branch June 9, 2025 14:08
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.

Couldn't make new command work with --src argument

2 participants