- Cleaned up せxample hooks, with clearer inline documentation.
This commit is contained in:
Paul Beckingham 2014-05-17 11:16:32 -04:00
parent de34095eb5
commit 11058396c8
4 changed files with 41 additions and 47 deletions

View file

@ -1,23 +1,22 @@
#!/bin/bash #!/bin/bash
# The on-add event is triggered separately for each task added
# Input: # Input:
# - New task JSON. # - A line of JSON for the task added
read new_task read new_task
# Processing goes here. # Processing goes here
# Output: # Output:
# - Any line of JSON emitted is added as a new task. # - all emitted JSON lines must be fully-formed tasks
# - Any non-JSON emitted is displayed as a message. # - all emitted non-JSON lines are considered feedback messages
echo on-add echo on-add
# Exit: # Exit:
# - 0 Means accept $new_task if JSON is not emitted. # 0 Means: - all emitted JSON lines are added/modifiied
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this # - all emitted non-JSON lines become footnote entries
# JSON instead of $new_task. If UUID does not match $new_task, then these # 1 Means: - all emitted JSON lines are ignored
# are additional tasks. # - all emitted non-JSON lines become error entries
# - 0 Means all non-JSON becomes footnote entries.
# - 1 Means all non-JSON becomes error entries.
# - 1 Means reject $new_task.
exit 0 exit 0

View file

@ -1,22 +1,19 @@
#!/bin/bash #!/bin/bash
# Input: # The on-exit event is triggered once, after all processing is complete
# - None
# Processing goes here. # Input:
# - A read-only line of JSON for each task added/modified
# Processing goes here
# Output: # Output:
# - Any line of JSON emitted is added as a new task. # - all emitted JSON lines must be fully-formed tasks
# - Any non-JSON emitted is displayed as a message. # - all emitted non-JSON lines are considered feedback messages
echo on-exit echo on-exit
# Exit: # Exit:
# - 0 Means accept $new_task if JSON is not emitted. # 0 Means: - all emitted non-JSON lines become footnote entries
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this # 1 Means: - all emitted non-JSON lines become error entries
# JSON instead of $new_task. If UUID does not match $new_task, then these
# are additional tasks.
# - 0 Means all non-JSON becomes footnote entries.
# - 1 Means all non-JSON becomes error entries.
# - 1 Means reject $new_task.
exit 0 exit 0

View file

@ -1,22 +1,21 @@
#!/bin/bash #!/bin/bash
# Input: # The on-launch event is triggered once, after initialization, before an
# - None # processing occurs
# Processing goes here. # No input
# Processing goes here
# Output: # Output:
# - Any line of JSON emitted is added as a new task. # - all emitted JSON lines must be fully-formed tasks
# - Any non-JSON emitted is displayed as a message. # - all emitted non-JSON lines are considered feedback messages
echo on-launch echo on-launch
# Exit: # Exit:
# - 0 Means accept $new_task if JSON is not emitted. # 0 Means: - all emitted JSON lines are added/modifiied
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this # - all emitted non-JSON lines become footnote entries
# JSON instead of $new_task. If UUID does not match $new_task, then these # 1 Means: - all emitted JSON lines are ignored
# are additional tasks. # - all emitted non-JSON lines become error entries
# - 0 Means all non-JSON becomes footnote entries.
# - 1 Means all non-JSON becomes error entries.
# - 1 Means reject $new_task.
exit 0 exit 0

View file

@ -1,25 +1,24 @@
#!/bin/bash #!/bin/bash
# The on-modify event is triggered separately for each task added or modified
# Input: # Input:
# - Original task JSON # - A line of JSON for the original task
# - Modified task JSON # - A line of JSON for the modified task
read original_task read original_task
read modified_task read modified_task
# Processing goes here. # Processing goes here
# Output: # Output:
# - Any line of JSON emitted is added as a new task. # - all emitted JSON lines must be fully-formed tasks
# - Any non-JSON emitted is displayed as a message. # - all emitted non-JSON lines are considered feedback messages
echo on-modify echo on-modify
# Exit: # Exit:
# - 0 Means accept $new_task if JSON is not emitted. # 0 Means: - all emitted JSON lines are added/modifiied
# - 0 Means accept all JSON as new tasks. If UUID matches $new_task, use this # - all emitted non-JSON lines become footnote entries
# JSON instead of $new_task. If UUID does not match $new_task, then these # 1 Means: - all emitted JSON lines are ignored
# are additional tasks. # - all emitted non-JSON lines become error entries
# - 0 Means all non-JSON becomes footnote entries.
# - 1 Means all non-JSON becomes error entries.
# - 1 Means reject $new_task.
exit 0 exit 0