timetrap 1.8.8 → 1.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -1
- data/completions/bash/timetrap-autocomplete.bash +17 -0
- data/completions/zsh/_t +31 -0
- data/lib/timetrap/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95a6321f81345876d080915bfa463773aec4a323
|
4
|
+
data.tar.gz: 080e67a839ea706bb7999ff5d62decd4927fec26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8f99b00dd16717a9c86e525363e1dfeb3fca1c67261f5c3a418877a4fb766c78b7e074ee83fa85e36a9d9ac3d4e680e5386db6ec1df9596e3a1e0bcfbf3e7c3
|
7
|
+
data.tar.gz: 1e6138b8903a54cba1203ab09e4927be4db650089f046b0befd3386cb9c15747145fbde2a62cdbf7b8a72a5b4e8ca2e24b694f8c8330f970797826a1ad20303b
|
data/README.md
CHANGED
@@ -64,7 +64,7 @@ You check out with the `out` command.
|
|
64
64
|
$ t out
|
65
65
|
Checked out of sheet "coding"
|
66
66
|
|
67
|
-
Running `edit` when you're checked out will edit the last
|
67
|
+
Running `edit` when you're checked out will edit the last entry you checked out
|
68
68
|
of.
|
69
69
|
|
70
70
|
$ t edit --append "oh and that"
|
@@ -372,6 +372,40 @@ See ``t configure`` for details. Currently supported options are:
|
|
372
372
|
|
373
373
|
**auto_checkout**: Automatically check out of running entries when you check in
|
374
374
|
|
375
|
+
Autocomplete
|
376
|
+
------------
|
377
|
+
|
378
|
+
Timetrap has some basic support for autocomplete in bash and zsh.
|
379
|
+
There are completions for commands and for sheets.
|
380
|
+
|
381
|
+
**HINT** If you don't know where timetrap is installed,
|
382
|
+
have a look in the directories listed in `echo $GEM_PATH`.
|
383
|
+
|
384
|
+
### bash
|
385
|
+
|
386
|
+
If it isn't already, add the following to your `.bashrc`/`.bash_profile`:
|
387
|
+
|
388
|
+
```bash
|
389
|
+
if [ -f /etc/bash_completion ]; then
|
390
|
+
. /etc/bash_completion
|
391
|
+
fi
|
392
|
+
```
|
393
|
+
|
394
|
+
Then add this to source the completions:
|
395
|
+
|
396
|
+
```bash
|
397
|
+
source /path/to/timetrap-1.x.y/gem/completions/bash/timetrap-autocomplete.bash
|
398
|
+
```
|
399
|
+
|
400
|
+
### zsh
|
401
|
+
|
402
|
+
You need to add timetrap's zsh completions directory to your `$fpath`,
|
403
|
+
so add the following to your `.zshrc`:
|
404
|
+
|
405
|
+
```zsh
|
406
|
+
fpath=(/path/to/timetrap-1.x.y/gem/completions/zsh $fpath)
|
407
|
+
```
|
408
|
+
|
375
409
|
Special Thanks
|
376
410
|
--------------
|
377
411
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
_timetrap ()
|
3
|
+
{
|
4
|
+
cur="${COMP_WORDS[COMP_CWORD]}"
|
5
|
+
cmd="${COMP_WORDS[1]}"
|
6
|
+
if [[ ( $cmd = s* || $cmd = d* ) && "$COMP_CWORD" = 2 ]]; then
|
7
|
+
COMPREPLY=($(compgen -W "$(echo "select distinct sheet from entries where sheet not like '\_%';" | sqlite3 ~/.timetrap.db)" $cur))
|
8
|
+
return
|
9
|
+
elif [[ "$COMP_CWORD" = 1 ]]; then
|
10
|
+
CMDS="archive backend configure display edit in kill list now out resume sheet week month"
|
11
|
+
COMPREPLY=($(compgen -W "$CMDS" $cur))
|
12
|
+
fi
|
13
|
+
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
complete -F _timetrap 't'
|
data/completions/zsh/_t
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#compdef t
|
2
|
+
|
3
|
+
_t() {
|
4
|
+
local curcontext="$curcontext" state line
|
5
|
+
typeset -A opt_args
|
6
|
+
|
7
|
+
_arguments \
|
8
|
+
'1: :->t_command'\
|
9
|
+
'2: :->first_arg'
|
10
|
+
|
11
|
+
case $state in
|
12
|
+
t_command)
|
13
|
+
compadd "$@" archive backend configure display edit in kill\
|
14
|
+
list now out resume sheet week month
|
15
|
+
;;
|
16
|
+
|
17
|
+
first_arg)
|
18
|
+
# If the first argument starts with s or d (sheet or display),
|
19
|
+
# the second argument can be autocompleted to one of the existing
|
20
|
+
# non-archived sheets.
|
21
|
+
if [[ $words[2] == s* || $words[2] == d* ]]; then
|
22
|
+
query='SELECT DISTINCT(sheet) FROM entries WHERE sheet NOT LIKE "\_%" ESCAPE "\";'
|
23
|
+
echo $query | t b | while read sheet; do
|
24
|
+
compadd "$@" $sheet
|
25
|
+
done
|
26
|
+
fi
|
27
|
+
;;
|
28
|
+
esac
|
29
|
+
}
|
30
|
+
|
31
|
+
_t "$@"
|
data/lib/timetrap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timetrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Goldstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -156,6 +156,8 @@ files:
|
|
156
156
|
- VERSION.yml
|
157
157
|
- bin/dev_t
|
158
158
|
- bin/t
|
159
|
+
- completions/bash/timetrap-autocomplete.bash
|
160
|
+
- completions/zsh/_t
|
159
161
|
- lib/Getopt/Declare.rb
|
160
162
|
- lib/Getopt/DelimScanner.rb
|
161
163
|
- lib/timetrap.rb
|