diff --git a/Cargo.lock b/Cargo.lock index 16d24c3..23ff3e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,54 +2,84 @@ name = "clog" version = "0.7.0" dependencies = [ - "clap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", - "regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 1.0.0-beta (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "regex_macros 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ansi_term" -version = "0.5.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clap" -version = "0.10.0" +version = "1.0.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ansi_term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "gcc" -version = "0.3.5" +name = "kernel32-sys" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "libc" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "memchr" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "regex" -version = "0.1.30" +version = "0.1.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex_macros" -version = "0.1.17" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-serialize" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -59,23 +89,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "strsim" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "time" -version = "0.1.25" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "toml" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winapi" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + diff --git a/Cargo.toml b/Cargo.toml index 8aa1686..b97d4c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,19 +9,27 @@ version = "0.7.0" authors = ["Christoph Burgdorf "] description = "A conventional changelog for the rest of us" +[[bin]] +doc = false +name = "clog" + [dependencies] regex = "*" -time = "*" -clap = "*" semver = "*" toml = "*" +clap = "*" +time = "*" [dependencies.regex_macros] +version = "*" optional = true [features] default=[] +# For debugging output +debug=[] + # for building with nightly and unstable features # until regex_macros compiles with nightly again, this should be commented out # unstable = ["regex_macros"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..90aa29c --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +test: + cargo test + +build: + cargo build + +doc: + cd "$(THIS_DIR)" + cp src/lib.rs code.bak + cat README.md | sed -e 's/^/\/\/! /g' > readme.bak + sed -i '/\/\/ DOCS/r readme.bak' src/lib.rs + sed -e "s/\`rust/\`ignore/g" src/lib.rs + sed -e "s/\`toml/\`ignore/g" src/lib.rs + sed -e "s/\`sh/\`ignore/g" src/lib.rs + rm -rf docs/* + (cargo doc --no-deps && make clean) || (make clean && false) + +clean: + cp -r target/doc/* docs/ + cd "$(THIS_DIR)" + mv code.bak src/lib.rs || true + rm *.bak || true diff --git a/README.md b/README.md index f9c9049..d7ea2e4 100644 --- a/README.md +++ b/README.md @@ -20,29 +20,45 @@ The way this works, is every time you make a commit, you ensure your commit subj ### Usage -``` +There are two ways to use `clog`, via the command line or a library in your applicaitons. + +#### Command Line + +```sh USAGE: - clog [FLAGS] [OPTIONS] + clog [FLAGS] [OPTIONS] FLAGS: - --from-latest-tag use latest tag as start (instead of --from) + -c, --config The Clog Configuration TOML file to use (Defaults to '.clog.toml')** + -F, --from-latest-tag use latest tag as start (instead of --from) -h, --help Prints help information - --major Increment major version by one (Sets minor and patch to 0) - --minor Increment minor version by one (Sets patch to 0) - --patch Increment patch version by one - -v, --version Prints version information + -M, --major Increment major version by one (Sets minor and patch to 0) + -m, --minor Increment minor version by one (Sets patch to 0) + -p, --patch Increment patch version by one + -V, --version Prints version information OPTIONS: - --from e.g. 12a8546 + -f, --from e.g. 12a8546 + -g, --git-dir Local .git directory (defaults to current dir + '.git')* -o, --outfile Where to write the changelog (Defaults to 'changelog.md') - -r, --repository e.g. https://github.com/thoughtram/clog - --link-style