summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-12-13 19:24:22 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-12-13 19:24:22 +0100
commitfd1cacded7523724e57a2bec2dfaf0a867dabdf7 (patch)
tree515b0f8ed3b93d1e31fec9a3ceb0d4162838b6fc
parentb8e15051ff6a845b252a8f86f8a17ccad87b4336 (diff)
parentb3dc95542b7a0aca38e9b196d30f25f7defecf1b (diff)
Merge branch 'extract-libical'
-rw-r--r--.circleci/config.yml47
-rw-r--r--.circleci/images/rust-libical3-kcov/Dockerfile32
-rw-r--r--.circleci/images/rust-libical3/Dockerfile45
-rw-r--r--.gitignore15
-rw-r--r--.travis.yml16
-rw-r--r--Cargo.lock1186
-rw-r--r--Cargo.toml60
-rw-r--r--LICENSE674
-rw-r--r--LICENSE.lgpl503
-rw-r--r--LICENSE.mpl374
-rw-r--r--README.md18
-rw-r--r--archive/cal.rs165
-rw-r--r--archive/prettyprint.rs37
l---------bin/khagenda1
l---------bin/khcopy1
l---------bin/khcursor1
l---------bin/khdelete1
l---------bin/khedit1
-rwxr-xr-xbin/khgeneric4
l---------bin/khgrep1
l---------bin/khindex1
l---------bin/khlist1
l---------bin/khmodify1
l---------bin/khnew1
l---------bin/khselect1
l---------bin/khseq1
l---------bin/khshow1
l---------bin/khsort1
l---------bin/khundo1
-rw-r--r--notes/sample_agenda13
-rw-r--r--rustfmt.toml1
-rw-r--r--shell.nix27
-rw-r--r--src/actions/agenda.rs305
-rw-r--r--src/actions/calendars.rs25
-rw-r--r--src/actions/copy.rs45
-rw-r--r--src/actions/cursor.rs156
-rw-r--r--src/actions/delete.rs68
-rw-r--r--src/actions/edit.rs50
-rw-r--r--src/actions/gen_completions.rs35
-rw-r--r--src/actions/get.rs49
-rw-r--r--src/actions/index/action.rs182
-rw-r--r--src/actions/index/bucketable.rs162
-rw-r--r--src/actions/index/indextime.rs38
-rw-r--r--src/actions/index/mod.rs18
-rw-r--r--src/actions/list.rs32
-rw-r--r--src/actions/mod.rs16
-rw-r--r--src/actions/modify.rs140
-rw-r--r--src/actions/new.rs358
-rw-r--r--src/actions/select.rs86
-rw-r--r--src/actions/seq.rs79
-rw-r--r--src/actions/show.rs34
-rw-r--r--src/actions/undo.rs131
-rw-r--r--src/actions/unroll.rs37
-rw-r--r--src/backup.rs56
-rw-r--r--src/bin/khaleesi.rs87
-rw-r--r--src/calendars.rs33
-rw-r--r--src/cli.rs81
-rw-r--r--src/component.rs148
-rw-r--r--src/config.rs131
-rw-r--r--src/cursorfile.rs92
-rw-r--r--src/defaults.rs96
-rw-r--r--src/duration.rs181
-rw-r--r--src/edit.rs46
-rw-r--r--src/errors.rs83
-rw-r--r--src/icalwrap/icalcomponent.rs131
-rw-r--r--src/icalwrap/icalduration.rs177
-rw-r--r--src/icalwrap/icalproperty.rs60
-rw-r--r--src/icalwrap/icaltime.rs365
-rw-r--r--src/icalwrap/icaltimezone.rs153
-rw-r--r--src/icalwrap/icalvcalendar.rs670
-rw-r--r--src/icalwrap/icalvevent.rs394
-rw-r--r--src/icalwrap/mod.rs26
-rw-r--r--src/input.rs71
-rw-r--r--src/khevent.rs279
-rw-r--r--src/khline.rs280
-rw-r--r--src/lib.rs74
-rw-r--r--src/macros.rs32
-rw-r--r--src/property.rs62
-rw-r--r--src/selectors/cal.rs76
-rw-r--r--src/selectors/daterange.rs188
-rw-r--r--src/selectors/grep.rs98
-rw-r--r--src/selectors/mod.rs142
-rw-r--r--src/selectors/prop.rs81
-rw-r--r--src/selectors/range.rs79
-rw-r--r--src/selectors/test.rs30
-rw-r--r--src/seqfile.rs72
-rw-r--r--src/testdata.rs129
-rw-r--r--src/testutils.rs30
-rw-r--r--src/time.rs355
-rw-r--r--src/timezone.rs128
-rw-r--r--src/utils/dateutil.rs254
-rw-r--r--src/utils/fileutil.rs109
-rw-r--r--src/utils/lock.rs66
-rw-r--r--src/utils/misc.rs68
-rw-r--r--src/utils/mod.rs3
-rw-r--r--src/utils/stdioutils.rs124
-rw-r--r--src/vcalendar.rs618
-rw-r--r--src/vevent.rs397
98 files changed, 3207 insertions, 8926 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 782d19d..0000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-version: 2
-jobs:
- test:
- docker:
- - image: puzzlewolf/rust-libical3:0.7
- working_directory: /mnt/crate
- steps:
- - checkout
- - restore_cache:
- keys:
- - cargo-v2-{{ checksum "Cargo.toml" }}-
- - cargo-v2-
- - run: cargo update
- - run: cargo fetch
- - persist_to_workspace:
- root: "."
- paths:
- - Cargo.lock
- - save_cache:
- key: cargo-v2-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
- paths:
- - ~/.cargo/registry
- - ~/.cargo/git
- - run:
- name: Print version information
- command: rustc --version; cargo --version
- - run:
- name: Build and test
- command: cargo test --verbose --frozen
- environment:
- # Need this for the coverage run
- RUSTFLAGS: "-C link-dead-code"
- - run:
- name: Prune the output files
- command: |
- for file in target/debug/* target/debug/.??*; do
- [ -d $file -o ! -x $file ] && rm -r $file
- done
- - persist_to_workspace:
- root: "."
- paths:
- - target/debug/*
-workflows:
- version: 2
- test_all:
- jobs:
- - test
diff --git a/.circleci/images/rust-libical3-kcov/Dockerfile b/.circleci/images/rust-libical3-kcov/Dockerfile
deleted file mode 100644
index d9e9bb4..0000000
--- a/.circleci/images/rust-libical3-kcov/Dockerfile
+++ /dev/null
@@ -1,32 +0,0 @@
-#FROM debian:buster
-FROM puzzlewolf/rust-libical3:0.7
-
-ARG KCOV_GIT_REF
-
-RUN apt-get update
-# install pkg-config deliberately separate since it sometimes fails :( If it eventually
-# is installed we do not repeat the whole image build.
-#RUN apt-get install -y --fix-missing pkg-config
-RUN apt-get install -y wget libcurl4-openssl-dev libelf-dev libdw-dev cmake cmake-data g++ binutils-dev \
- libiberty-dev
-#RUN apt-get install -y libical-dev
-
-ENV SRC_DIR=/home/kcov-src \
- URL_GIT_KCOV=https://github.com/SimonKagstrom/kcov.git
-
-RUN git clone $URL_GIT_KCOV $SRC_DIR; \
- cd $SRC_DIR; \
- # default to latest tagged version
- DEFAULT_KCOV_GIT_REF=$(git tag --list | grep "^v[0-9]\+$" | sort -V | tail --lines 1); \
- KCOV_GIT_REF=${KCOV_GIT_REF:-$DEFAULT_KCOV_GIT_REF}; \
- git reset --hard $KCOV_GIT_REF;
-
-RUN cd $SRC_DIR && \
- mkdir build && \
- cd build && \
- cmake .. && \
- make && \
- make install
-
-ENTRYPOINT ["kcov"]
-CMD ["--help"]
diff --git a/.circleci/images/rust-libical3/Dockerfile b/.circleci/images/rust-libical3/Dockerfile
deleted file mode 100644
index ff4e1d9..0000000
--- a/.circleci/images/rust-libical3/Dockerfile
+++ /dev/null
@@ -1,45 +0,0 @@
-FROM buildpack-deps:buster
-
-# Some of the dependencies I need to build a few libraries,
-# personalize to your needs. You can use multi-stage builds
-# to produce a lightweight image.
-#RUN apt-get update && \
-# apt-get install -y curl file gcc g++ git make openssh-client \
-# autoconf automake cmake libtool libcurl4-openssl-dev libssl-dev \
-# libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \
-# xz-utils pkg-config python
-
-RUN apt-get update && \
- apt-get install -y libical-dev clang
-
-#ENV KCOV_VERSION 33
-#RUN wget https://github.com/SimonKagstrom/kcov/archive/v$KCOV_VERSION.tar.gz && \
-# tar xzf v$KCOV_VERSION.tar.gz && \
-# rm v$KCOV_VERSION.tar.gz && \
-# cd kcov-$KCOV_VERSION && \
-# mkdir build && cd build && \
-# cmake .. && make && make install && \
-# cd ../.. && rm -rf kcov-$KCOV_VERSION
-
-#RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
-
-ENV PATH "$PATH:/root/.cargo/bin"
-#ENV RUSTFLAGS "-C link-dead-code"
-#ENV CFG_RELEASE_CHANNEL "nightly"
-
-#RUN rustup update && \
-# rustup install nightly && \
-# rustup default nightly
-
-#ENV RUSTFMT_VERSION 0.3.1
-#RUN wget https://github.com/rust-lang-nursery/rustfmt/archive/${RUSTFMT_VERSION}.tar.gz && \
-# tar xzf ${RUSTFMT_VERSION}.tar.gz && rm ${RUSTFMT_VERSION}.tar.gz && \
-# cd rustfmt-${RUSTFMT_VERSION} && \
-# $HOME/.cargo/bin/cargo install --path . && \
-# cd .. && rm -rf rustfmt-${RUSTFMT_VERSION}
-
-#RUN bash -l -c 'echo $(rustc --print sysroot)/lib >> /etc/ld.so.conf'
-#RUN bash -l -c 'echo /usr/local/lib >> /etc/ld.so.conf'
-#RUN ldconfig
-#EXEC bash
diff --git a/.gitignore b/.gitignore
index ebe16a7..973ade5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,5 @@
-# Generated by Cargo
-# will have compiled files and executables
-/target/
-
-# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
-# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
-# Cargo.lock
+Cargo.lock
+target
# These are backup files generated by rustfmt
**/*.rs.bk
-
-# Don't commit ics files in this repo (typically)
-*.ics
-
-# Don't commit the Index folder
-.khaleesi/
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..53e3b66
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,16 @@
+matrix:
+ include:
+ - language: nix
+ script:
+ - nix-shell --pure --run "cargo build --all --all-features"
+
+jobs:
+ allow_failures:
+ - rust: nightly
+ fast_finish: true
+
+notifications:
+ email:
+ on_success: always
+ on_failure: always
+
diff --git a/Cargo.lock b/Cargo.lock
deleted file mode 100644
index f539ac2..0000000
--- a/Cargo.lock
+++ /dev/null
@@ -1,1186 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-[[package]]
-name = "aho-corasick"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "ansi_term"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "argon2rs"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "arrayvec"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "assert_fs"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "globwalk 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tempfile 3.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "atty"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "termion 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "autocfg"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "backtrace"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "backtrace-sys"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bindgen"
-version = "0.43.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cexpr 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "clang-sys 0.26.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "blake2-rfc"
-version = "0.2.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bstr"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cc"
-version = "1.0.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "cexpr"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cfg-if"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "chrono"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
- "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "clang-sys"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
- "libloading 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "clap"
-version = "2.33.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cloudabi"