#cargo-toml #cargo #license #nodejs #cli #package-json #cli-tool

bin+lib fold-license

Folding licenses from multiple dirs with cargo/Cargo.toml and yarn/package.json

1 stable release

1.0.0 May 18, 2022

#1489 in Rust patterns

MIT license

27KB
542 lines

githubcrates-iodocs-rs
Build Status

fold-license

Folding licenses from multiple dirs with cargo/Cargo.toml and yarn/package.json.

  • multiple repos dirs support with glob patterns.
    • eg.) fold-license -i path/to/repos1 -i path/to/repos2 -i path/to/repos3
    • eg.) fold-license -i path1/**/*/ -i path2/foo/bar
  • Repos type:
    • cargo/Cargo.toml repos of a Rust project. (Need cargo CLI installed env.)
    • yarn/packages.json repos of a Node.js project. (Need yarn CLI installed env.)
  • Output to:
    • STDOUT
    • File
  • Output with:
    • TOML format, non-pretty or pretty.
    • JSON format, non-pretty or pretty.
    • MSGPACK format, binary.
  • unification from a multiple licenses from a multiple source dirs.
  • Run-time configuration from:
    • Command line arguments.
    • Prepared configuration file.

Screenshots

  1. Run:

image

  1. And then you got the licenses for all of indivisual repos dirs!

image

Install

cargo install fold-licenses

Usage

note: This package include both of bin and lib. In this section, I explain only the bin version. See also lib.rs and docs if you want to use lib version.

fold-license --help:

USAGE:
    fold-license [OPTIONS]

OPTIONS:
    -c, --conf <CONF>        Use configuration file if set the path. -c path/to/conf.toml
        --cargo              `cargo`/Cargo.toml, enabled
    -f, --format <FORMAT>    toml, json, msgpack. -e json
    -h, --help               Print help information
    -i, --in <IN>            input glob pattern(s). -i aaa -i bbb -i ccc ...
    -o, --out <OUT>          output to the path if set. else, output to stdout
    -p, --pretty             pretty output. **ONLY TO USE WITH A TEXT FORMAT**
    -s, --silent             silet a log messages
    -V, --version            Print version information
        --yarn               `yarn`/packages.json, enabled
  1. eg.) fold-license -i . -i path/to/somewhere -i 'target/**/pattern/*' -o target/output.toml -s -p --cargo --yarn
  2. eg.) fold-license -c example/example-conf.toml if you want to use -c and prepared configuration file:
# example-conf.toml; `fold-license -c example/example-conf.toml`
format = "toml"
in = [".", "path/to/somewhere", "target/**/pattern/*"]
out = "target/output.toml"
silent = true
pretty = true
cargo = true
yarn = true

LICENSE

Author

Dependencies

~4.5–7MB
~126K SLoC