🚀 feat(_alias): add for c/cpp & rust

This commit is contained in:
eshanized
2024-12-21 04:51:43 +05:30
parent 24872eb913
commit 2b9ad66de7

38
.bashrc
View File

@@ -185,6 +185,44 @@ alias pyfreeze="pip freeze" # List installed packages in requirements format
alias pyinstall="pip install" # Install Python packages
alias pyuninstall="pip uninstall" # Uninstall Python packages
# C++ Aliases
alias cpp-compile="g++ -std=c++17 -Wall -Wextra -o output"
alias cpp-run="g++ -std=c++17 -Wall -Wextra -o output && ./output"
alias cpp-compile-opt="g++ -std=c++17 -O2 -Wall -Wextra -o output"
alias cpp-clean="rm -f output"
alias cpp-build-all="g++ -std=c++17 -Wall -Wextra *.cpp -o output"
alias cpp-edit="nano"
alias cpp-exec="./output"
# C Aliases
alias c-compile="gcc -std=c11 -Wall -Wextra -o output"
alias c-run="gcc -std=c11 -Wall -Wextra -o output && ./output"
alias c-compile-opt="gcc -std=c11 -O2 -Wall -Wextra -o output"
alias c-clean="rm -f output"
alias c-build-all="gcc -std=c11 -Wall -Wextra *.c -o output"
alias c-edit="nano"
alias c-exec="./output"
# Rust Aliases
alias rustc="rustc" # Compile Rust programs with rustc
alias rust-run="cargo run" # Run the current Rust project
alias rust-build="cargo build" # Build the current Rust project
alias rust-build-rel="cargo build --release" # Build in release mode (optimized)
alias rust-test="cargo test" # Run tests for the current project
alias rust-clean="cargo clean" # Clean the build directory
alias rust-fmt="cargo fmt" # Format Rust code
alias rust-clippy="cargo clippy" # Run Clippy (linter for Rust)
alias rust-doc="cargo doc --open" # Generate and open documentation
alias rust-new="cargo new" # Create a new Rust project
alias rust-init="cargo init" # Initialize a new Rust project in an existing directory
alias rust-add="cargo add" # Add a dependency to the project
alias rust-upd="rustup update" # Update Rust toolchain
alias rust-ver="rustc --version" # Display Rust version
alias rust-watch="cargo watch -x run" # Watch for changes and run automatically
alias rust-deps="cargo tree" # Show dependency tree
alias rust-check="cargo check" # Check code without building it
alias rust-ls="ls -alh --color=auto" # List project directory contents
# Alias to change to different shells
alias cbash="chsh -s /bin/bash" # Change to Bash
alias czsh="chsh -s /bin/zsh" # Change to Zsh