Merge pull request #164 from matthiasbeyer/bin/imag

Bin/imag
This commit is contained in:
Matthias Beyer 2016-02-09 13:43:52 +01:00
commit bdbe024eb5
4 changed files with 91 additions and 38 deletions

View file

@ -36,25 +36,26 @@ script:
travis_cargo_run_in() { travis_cargo_run_in() {
[[ -d "$1" ]] && [[ -d "$1" ]] &&
cd "$1" && cd "$1" &&
{
travis-cargo build && travis-cargo build &&
travis-cargo test && travis-cargo test &&
travis-cargo bench && travis-cargo bench &&
travis-cargo --only stable doc && travis-cargo --only stable doc &&
cd - cd -
} || exit 1
} }
[[ $(changes_in "doc") ]] && echo "Changes in ./doc are not build by CI" [[ $(changes_in "doc") ]] && echo "Changes in ./doc are not build by CI"
for d in $(find -name "Cargo.toml" | grep -vE "^.$"); do for d in $(find -name "Cargo.toml" | grep -vE "^.$"); do
dir=$(dirname $d) dir=$(dirname $d)
{
changes_in $dir && \ changes_in $dir && \
echo -e "\nRunning in $d\n" && \ echo -e "\nRunning in $d\n" && \
travis_cargo_run_in $dir travis_cargo_run_in $dir
} || true
done done
echo -e "\nRunning on top-level crate...\n"
travis_cargo_run_in "."
addons: addons:
apt: apt:
packages: packages:

View file

@ -1,23 +0,0 @@
[package]
name = "imag"
version = "0.1.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
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"

79
bin/imag Executable file
View file

@ -0,0 +1,79 @@
#!/usr/bin/env bash
version() {
echo "0.1.0"
}
help() {
local cmds="$(commands)"
echo " _ ";
echo " (_)_ __ ___ __ _ __ _ ";
echo " | | '_ \` _ \ / _\` |/ _\` |";
echo " | | | | | | | (_| | (_| |";
echo " |_|_| |_| |_|\__,_|\__, |";
echo " |___/ ";
echo " -------------------------";
cat <<EOS
Usage: imag [--version | --versions | -h | --help] <command> <args...>
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 <command> <args>"
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
--versions)
echo -n "imag "; version
for command in $(commands); do
$command --version
done
exit 0
;;
--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 $*

View file

@ -1,4 +0,0 @@
fn main() {
println!("It works");
}