Crates.io | mkmod |
lib.rs | mkmod |
version | 0.0.2 |
source | src |
created_at | 2022-09-12 22:21:15.604777 |
updated_at | 2022-09-12 22:48:07.804746 |
description | CLI for adding modules to Rust projects. |
homepage | |
repository | https://github.com/bicarlsen/mkmod |
max_upload_size | |
id | 664022 |
size | 58,754 |
Creates a new module in a Rust project. This is done by creating a file or directory based on the name of the module provided. The module can include a seperate test file, and be automatically added to its partent module.
This requires cargo to be installed.
Run cargo +nightly install mkmod
from your terminal.
Download the mkmod
executable from the desired release and add it to your path.
mkmod new_mod
Adds a new file module called new_mod
to the current directory.
This will add the files new_mod.rs
and new_mod_test.rs
to the directory.
new_mod.rs
will contain testing boilerplate pointing to the new_mod_test.rs
file.
new_mod
will also be added as a public module to its parent.
mkmod big_mod --dir
Adds a new directory module named big_mod
to the current directory.
This will add a directory called big_mod
to the current directory with files
mod.rs
and mod_test.rs
.
mod.rs
will have testing boilerplate pointing to the mod_test.rs
file.
mkmod my_mod --main
By default, modules added to the root directory will first try to be added
to lib.rs
. If lib.rs
does not exist, they will then attempt to be added to main.rs
.
You can force a module to be added to main.rs
using the --main
flag.
mkmod path/to/my_mod
mkmod my_mod --no-test
mkmod my_mod --no-add
mkmod my_mod --private