#open #editor #cargo #cargo-subcommand #crates

app cargo-open

Cargo command to open an installed crate in your editor

2 stable releases

new 1.0.1 May 16, 2024
0.4.0 Aug 14, 2019
0.3.0 Aug 24, 2015
0.1.0 Aug 23, 2015

#61 in Cargo plugins

Download history 1/week @ 2024-02-16 6/week @ 2024-02-23 2/week @ 2024-03-01 3/week @ 2024-03-08 2/week @ 2024-03-15 36/week @ 2024-03-29 13/week @ 2024-04-05

237 downloads per month

MIT license

8KB
83 lines

cargo-open

A cargo subcommand to open an installed crate in your $EDITOR, modelled on bundle open.

Note that the intended use is to open a crate's source for reading. Making changes to installed crates is not reccommended, and may produce unexpected results. Instead, clone the crate locally and specify the path in your Cargo.toml.

Installation

This is a binary crate, so it's installed manually rather than as a dependency:

cargo install cargo-open

Usage

cargo open clap

Configuration

The editor command is picked from the CARGO_EDITOR, VISUAL, or EDITOR environment variables, checked in that order.

Specify a different manifest file with the --manifest-path option. By default, Cargo.toml in the current directory is used.

Todo/Contributing

There aren't any tests, as this is just glueing together the cargo-metadata crate and some bits from the standard library. As such it should be robust, and what little logic there is should be adequately constrained by the type system.

Regardless, if you have any problems, suggestions or improvements, feel free to create an issue or PR.

This project uses cargo-readme to export this README from the doc comments.

Attribution

The original cargo-open was authored by Carol Nichols (@carols10cents), and crate ownership was transferred in may 2024. Many thanks to Carol for all her work in the rust community.

License: MIT

Dependencies

~1.9–2.8MB
~54K SLoC