From 60d680b88108553f06126d1a16d82a896d4fb3f1 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 29 Jan 2016 22:57:36 +0100 Subject: [PATCH 1/6] Add main imag binary --- bin/imag | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 bin/imag diff --git a/bin/imag b/bin/imag new file mode 100755 index 00000000..fc8bd5ce --- /dev/null +++ b/bin/imag @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +version() { + echo "0.1.0" +} + +help() { + local cmds="$(commands)" + + cat < + + imag - the personal information management suite for the commandline + + imag is a PIM suite for the commandline. It consists of several commands, + called "modules". Each module implements one PIM aspect and all of these + modules can be used independently. + + Available commands: + $(for cmd in $cmds; do + echo -e "\t$(echo $cmd | sed -r 's,(.*)/imag-(.*),\2,')"; + done) + + Call a command with "imag " + Each command can be called with "--help" to get the respective helptext. + + Please visit https://github.com/matthiasbeyer/imag to view the source code, + follow the development of imag or maybe even contribute to imag. + + imag is free software. It is released under the terms of LGPLv2.1 + + (c) 2016 Matthias Beyer and contributors +EOS +} + +commands() { + [[ ! -z "$IMAG_IS_THE_SHIT" ]] && \ + find $IMAG_IS_THE_SHIT -type f -iname "imag-*" -print 2>/dev/null + find ${PATH//:/ } -maxdepth 1 -type f -iname "imag-*" -print 2>/dev/null +} + +main() { + case $1 in + --version) + version + exit 0 + ;; + + --help | -h) + help + exit 0 + ;; + + *) + local cmd=$1; shift + local executable=$(commands | grep $cmd | head -n 1) + exec $executable $* + ;; + + esac +} + +main $* From fe7ed7c64df36e8a1c485c5e5fc7e5393eccf094 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 31 Jan 2016 13:44:48 +0100 Subject: [PATCH 2/6] Add possibility to list all versions --- bin/imag | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/imag b/bin/imag index fc8bd5ce..0c51fadc 100755 --- a/bin/imag +++ b/bin/imag @@ -8,7 +8,7 @@ help() { local cmds="$(commands)" cat < + Usage: imag [--version | --versions | -h | --help] imag - the personal information management suite for the commandline @@ -41,6 +41,14 @@ commands() { main() { case $1 in + --versions) + echo -n "imag "; version + for command in $(commands); do + $command --version + done + exit 0 + ;; + --version) version exit 0 From e3f8930c62156b22e500333026db38df31af7021 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 1 Feb 2016 22:36:46 +0100 Subject: [PATCH 3/6] Add ascii-art logo --- bin/imag | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/imag b/bin/imag index 0c51fadc..552ea9b4 100755 --- a/bin/imag +++ b/bin/imag @@ -7,7 +7,15 @@ version() { help() { local cmds="$(commands)" + echo " _ "; + echo " (_)_ __ ___ __ _ __ _ "; + echo " | | '_ \` _ \ / _\` |/ _\` |"; + echo " | | | | | | | (_| | (_| |"; + echo " |_|_| |_| |_|\__,_|\__, |"; + echo " |___/ "; + echo " -------------------------"; cat < imag - the personal information management suite for the commandline From ade9a03392e610e05e9d380592c9f011e74a9bf9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 7 Feb 2016 01:19:08 +0100 Subject: [PATCH 4/6] Remove old top-level codebase --- Cargo.toml | 23 ----------------------- src/main.rs | 4 ---- 2 files changed, 27 deletions(-) delete mode 100644 Cargo.toml delete mode 100644 src/main.rs diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index b5f4a833..00000000 --- a/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "imag" -version = "0.1.0" -authors = ["Matthias Beyer "] -repository = "https://github.com/matthiasbeyer/imag" -homepage = "https://github.com/matthiasbeyer/imag" -license = "LGPLv2" -readme = "README.md" -description = "CLI PIM suite with nice API, so you can use an MUA, Editor, etc. of your choice" -keywords = ["PIM", "personal", "information", "management", "cli", "vcard", "ical", "wiki", "bookmark", "todo", "rss" ] - -[dependencies.libimagmodule] -path = "./libimagmodule" - -[dependencies.libimagrt] -path = "./libimagstore" - -[dependencies.libimagstore] -path = "./libimagstore" - -[dependencies.libimagutil] -path = "./libimagutil" - diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 32486748..00000000 --- a/src/main.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - println!("It works"); -} - From 1a61e8b1d5fe6bcfa72404df8c581bce86079d96 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 7 Feb 2016 01:25:23 +0100 Subject: [PATCH 5/6] travis: We dont need to build the top-level anymore --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2381108..2236b017 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,9 +52,6 @@ script: travis_cargo_run_in $dir done - echo -e "\nRunning on top-level crate...\n" - travis_cargo_run_in "." - addons: apt: packages: From 34640282671956eb00bd2700cbca6aaab7faee0e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 7 Feb 2016 01:34:50 +0100 Subject: [PATCH 6/6] Travis: Fail only if there are failed {builds, tests, benchs} --- .travis.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2236b017..fd3a6f6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,20 +36,24 @@ script: travis_cargo_run_in() { [[ -d "$1" ]] && cd "$1" && - travis-cargo build && - travis-cargo test && - travis-cargo bench && - travis-cargo --only stable doc && - cd - + { + travis-cargo build && + travis-cargo test && + travis-cargo bench && + travis-cargo --only stable doc && + cd - + } || exit 1 } [[ $(changes_in "doc") ]] && echo "Changes in ./doc are not build by CI" for d in $(find -name "Cargo.toml" | grep -vE "^.$"); do dir=$(dirname $d) - changes_in $dir && \ - echo -e "\nRunning in $d\n" && \ - travis_cargo_run_in $dir + { + changes_in $dir && \ + echo -e "\nRunning in $d\n" && \ + travis_cargo_run_in $dir + } || true done addons: