Crates.io | bts |
lib.rs | bts |
version | 0.3.0 |
source | src |
created_at | 2019-09-28 16:17:42.935359 |
updated_at | 2020-03-19 14:45:18.124487 |
description | Simple template spawner |
homepage | https://github.com/luke-biel/bts |
repository | https://github.com/luke-biel/bts |
max_upload_size | |
id | 168455 |
size | 52,023 |
Command line utility to create simple file snippets available to be instantiated at any time in future
It allows to register and spawn snippets at will
cargo install bts
Instantiate copy of an existing snippet
bts new SOURCE [DESTINATION] [-w/--with-parent] [-m/--max-depth _]
It's good idea to remember that for the time being snippets are stored in directories.
Therefore nesting is allowed and advised.
For example,
config/mysql
, config/psql
, config/sqlite
are good examples of template names
and
config_mysql
, config_psql
, config_sqlite
are, while correct, discouraged.
But hey, these are your snippets. Consider it only to be an advice.
Place where you want to instantiate a snippet. By default pwd
is used.
This means that bts basic/template01 -w
will spawn files in ./basic/template01/
instead of .
Copies snippet only until given depth is reached in directory tree. For example,
basic/template01/
|- file.txt
|-/ subdir
bts new basic/template01 -m 1
will produce only file.txt in current directory. This parameter accepts numbers in range 0..255, default value is 32.
Create new snippet from files
bts register TEMPLATE_NAME SOURCE [-a/--append] [-m/--max-depth]
It clears previous snippets stored at given namespace, so calling bts basic .
will also remove basic/template01
.
When SOURCE is a file, this file will be stored at snippet namespace. When SOURCE is a directory, all contents of that directory will be stored at snippet namespace.
This allows to create snippet only from selected files in directory.
bts
search for files when creating a snippet.Accepts numbers between 0 and 255, default value is 32.
I may accept new features, but that will only happen if I can see that it's useful.
It's better to create issue at github before attempting to implement something.
Bug fixes are always welcome.
You can look into .travis.yml
for build steps, but tldr is that I will merge only features that pass
cargo clippy --all-targets --all-features -- -D warnings
and
cargo fmt --all -- --check
bts spawn cargo/bin
calls cargo new --bin
)License: MIT