Crates.io | cdw |
lib.rs | cdw |
version | 0.2.0 |
source | src |
created_at | 2024-08-24 03:14:04.927123 |
updated_at | 2024-08-24 03:14:04.927123 |
description | Change directory to a Windows path in WSL with ease |
homepage | https://github.com/aarmn/cdw |
repository | https://github.com/aarmn/cdw |
max_upload_size | |
id | 1349792 |
size | 36,259 |
CDW (Change Directory (cd) for Windows path) is a powerful and user-friendly command-line tool that seamlessly bridges the gap between Windows and WSL (Windows Subsystem for Linux) file systems. Say goodbye to the hassle of manually converting Windows paths to WSL paths, just copy your windows path! 🎉
Install CDW using Cargo:
cargo install cdw
Initialize CDW for your shell:
cdw --init
Restart your shell or source your shell's configuration file as outputed
Start using CDW:
cdw C:\Users\YourName\Documents
Clone the repository:
git clone https://github.com/aarmn/cdw.git
Build the project:
cd cdw
cargo build --release
Initialize CDW for your shell:
./target/release/cdw --init
Restart your shell or source your shell's configuration file.
Start using CDW:
cdw C:\Users\YourName\Documents
cdw [OPTIONS] [PATH]
-i
, --init
: Initialize shell function--init-all
: Initialize shell function for all available shells--init-display <SHELL>
: Display shell function for a specific shell-v
, --verbose
: Enable verbose mode-c
, --convert
: Convert path without changing directory--help
: Display help information# Change directory to a Windows path
cdw 'C:\Users\YourName\Documents' # using `'` is necessary in bash for `\` to be interpreted as raw string and remain unescaped, check your shells for more info on raw/unescaped strings
# Convert a Windows path to WSL path without changing directory
cdw -c D:\Projects\MyProject
# Initialize CDW for your current shell
cdw --init
# Display the shell function for Zsh
cdw --init-display zsh
# Initialize CDW for all shells available (🚧WIP)
cdw --init-all
Shell | Escape char (non N/A) | Space support without escaping backslash | Example |
---|---|---|---|
xonsh | nothing or r"" or r'' | ❌ | cdw C: (: and \ terminated paths issue) or cdw r"C:\" or cdw r'C:\' |
bash | '' | ✅ | cdw 'C:\' |
nushell | nothing | ❌ | cdw C:\ |
fish | nothing | ❌ | cdw C: (: and \ terminated paths issue) |
sh/dash | '' | ✅ | cdw 'C:\' |
zsh | '' | ✅ | cdw 'C:\' |
powershell | nothing | ✅ | cdw C:\ |
CDW automatically creates shell-specific functions and autocompletion scripts in ~/.config/cdw/
. You can customize these files to fit your needs. Just be careful, by calling init
and init-all
flags, it will be overwritten.
--init-all
feature is currently a work in progress.cd
, but without support for cd
flags, as they are rarely used.:
or \
in your file names. This limitation is acknowledged and may be addressed in future versions.ksh
cd
command (activate only if using Windows-style path, pass unknown flags downstream, test for no collision with cd flags in common shells):
and \
in their names in linux, in possible drop-in replacement solutions.Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to all the contributors and users who have helped improve CDW!
Made with ❤️ by Aryan L. Horizon (AARMN)
🌟 If you find CDW useful, please consider giving it a star on GitHub! 🌟