diff --git a/cargo-process.el b/cargo-process.el index be437b5..c50f5c2 100644 --- a/cargo-process.el +++ b/cargo-process.el @@ -32,6 +32,7 @@ ;; * cargo-process-init - Create a new cargo project inside an existing directory. ;; * cargo-process-run - Build and execute src/main.rs. ;; * cargo-process-run-example - Build and execute with --example . +;; * cargo-process-run-bin - Build and execute a specific binary. ;; * cargo-process-search - Search registry for crates. ;; * cargo-process-test - Run all unit tests. ;; * cargo-process-update - Update dependencies listed in Cargo.lock. @@ -282,6 +283,15 @@ Cargo: Build and execute src/main.rs." (interactive) (cargo-process--start "Run" "cargo run")) +;;;###autoload +(defun cargo-process-run-bin (command) + "Run the Cargo run command --bin . +With the prefix argument, modify the command's invocation. +Cargo: Build and execute a specific binary" + (interactive) + (cargo-process--start (concat "Run " command) + (concat "cargo run --bin " command))) + ;;;###autoload (defun cargo-process-run-example (command) "Run the Cargo run command --example .