Add-ons
- Suppressed output using rc.verbose=nothing. - Removed [...] from output with rc.json.array=no.
This commit is contained in:
@@ -38,7 +38,7 @@ if ($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
my $command = join (' ', ("env PATH=$ENV{PATH} task export", @ARGV));
|
my $command = join (' ', ("env PATH=$ENV{PATH} task rc.verbose=nothing rc.json.array=no export", @ARGV));
|
||||||
if ($command =~ /No matches/)
|
if ($command =~ /No matches/)
|
||||||
{
|
{
|
||||||
printf STDERR $command;
|
printf STDERR $command;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
my $command = join (' ', ("env PATH='$ENV{PATH}' task export", @ARGV));
|
my $command = join (' ', ("env PATH='$ENV{PATH}' task rc.verbose=nothing rc.json.array=no export", @ARGV));
|
||||||
if ($command =~ /No matches/)
|
if ($command =~ /No matches/)
|
||||||
{
|
{
|
||||||
printf STDERR $command;
|
printf STDERR $command;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
my $command = join (' ', ("env PATH=$ENV{PATH} task export", @ARGV));
|
my $command = join (' ', ("env PATH=$ENV{PATH} task rc.verbose=nothing rc.json.array=no export", @ARGV));
|
||||||
if ($command =~ /No matches/)
|
if ($command =~ /No matches/)
|
||||||
{
|
{
|
||||||
printf STDERR $command;
|
printf STDERR $command;
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ def main():
|
|||||||
""" Return a list of SQL statements. """
|
""" Return a list of SQL statements. """
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
command = "task export " + " ".join(sys.argv[1:])
|
command = "task rc.verbose=nothing rc.json.array=no export " + " ".join(sys.argv[1:])
|
||||||
|
|
||||||
# Load each task from json to a python dict
|
# Load each task from json to a python dict
|
||||||
tasks = map(json.loads, commands.getoutput(command).split(",\n"))
|
tasks = map(json.loads, commands.getoutput(command).split(",\n"))
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
my $command = join (' ', ("env PATH=$ENV{PATH} task export", @ARGV));
|
my $command = join (' ', ("env PATH=$ENV{PATH} task rc.verbose=nothing rc.json.array=no export", @ARGV));
|
||||||
if ($command =~ /No matches/)
|
if ($command =~ /No matches/)
|
||||||
{
|
{
|
||||||
printf STDERR $command;
|
printf STDERR $command;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
my $command = join (' ', ("env PATH=$ENV{PATH} task export", @ARGV));
|
my $command = join (' ', ("env PATH=$ENV{PATH} task rc.verbose=nothing rc.json.array=no export", @ARGV));
|
||||||
if ($command =~ /No matches/)
|
if ($command =~ /No matches/)
|
||||||
{
|
{
|
||||||
printf STDERR $command;
|
printf STDERR $command;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import commands
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
command = "/usr/local/bin/task export " + " ".join (sys.argv[1:])
|
command = "/usr/local/bin/task rc.verbose=nothing rc.json.array=no export " + " ".join (sys.argv[1:])
|
||||||
|
|
||||||
# Generate output.
|
# Generate output.
|
||||||
print "<tasks>"
|
print "<tasks>"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ require 'rubygems'
|
|||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
lines = IO.popen("/usr/local/bin/task export " + ARGV.join(" ")).readlines
|
lines = IO.popen("/usr/local/bin/task rc.verbose=nothing rc.json.array=no export " + ARGV.join(" ")).readlines
|
||||||
|
|
||||||
# Generate output.
|
# Generate output.
|
||||||
print "<tasks>\n"
|
print "<tasks>\n"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
# Use the taskwarrior 2.0+ export command to filter and return JSON
|
||||||
my $command = join (' ', ("env PATH=$ENV{PATH} task export", @ARGV));
|
my $command = join (' ', ("env PATH=$ENV{PATH} task rc.verbose=nothing rc.json.array=no export", @ARGV));
|
||||||
if ($command =~ /No matches/)
|
if ($command =~ /No matches/)
|
||||||
{
|
{
|
||||||
printf STDERR $command;
|
printf STDERR $command;
|
||||||
|
|||||||
Reference in New Issue
Block a user