diff options
| author | Teddy Wing | 2018-02-12 22:57:29 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-02-12 22:57:29 +0100 |
| commit | 2ec7252024d85620611a1834b298308ec6179f02 (patch) | |
| tree | bcc087b5d985c5300f4ca3ca160ff2bb2a3cdd45 | |
| parent | b25764a4bfc9cdc79db7baa707c58ee32c510347 (diff) | |
| download | harvester-2ec7252024d85620611a1834b298308ec6179f02.tar.bz2 | |
harvester: Implement the `--list-modules` flag
When given with a project (project must come first in the argument
list), a list of all the modules (known as "tasks" in Harvest speak)
will be printed to the console, filtered from a list fetched by 'hcl'.
With no project argument, all tasks for all projects will be printed.
| -rwxr-xr-x | harvester | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -56,6 +56,15 @@ function hcl_log () { hcl log "$date" "@${project}" "$time" "$description" } +function list_modules () { + local project="$1" + + local project_id=$(grep "$project" $HOME/.hcl/settings.yml | + cut -d ' ' -f 2) + + hcl tasks | grep "^${project_id}" +} + function main () { local project='' local time='7' @@ -113,8 +122,9 @@ function main () { continue ;; --list-modules) - shift - continue + list_modules "$project" + + return 0 ;; --help) print_usage |
