aboutsummaryrefslogtreecommitdiff
path: root/cmd.ha
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2024-11-15 01:14:07 +0100
committerJulian Hurst <ark@mansus.space>2024-11-15 01:14:07 +0100
commit189c3af4052d543ce816637d97fed926fefa5c47 (patch)
tree3e04183827064e52aeb954c5495a283c9f6ff2c6 /cmd.ha
parente2bee01af84bc7a6bc191f931f195b3c0b5175cc (diff)
downloadhatask-189c3af4052d543ce816637d97fed926fefa5c47.tar.gz
csv -> tsv
Diffstat (limited to 'cmd.ha')
-rw-r--r--cmd.ha16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd.ha b/cmd.ha
index 6924fa9..3335209 100644
--- a/cmd.ha
+++ b/cmd.ha
@@ -7,7 +7,7 @@ use path;
use os::exec;
use strconv;
use ascii;
-use csv;
+use tsv;
type error = !(!str | io::error | path::error | exec::error | strconv::error);
@@ -40,8 +40,8 @@ const commands: [_]command = [
func = &do,
},
command {
- names = ["c", "csv"],
- func = &csv,
+ names = ["t", "tsv"],
+ func = &tsv,
},
];
@@ -83,11 +83,11 @@ fn show(tasks: []task, a: arguments) (void | task | error) = {
fmt::println(t.content)!;
};
-fn printtaskcsv(t: task, id: size) (void | error) = {
+fn printtasktsv(t: task, id: size) (void | error) = {
const sid = strings::dup(strconv::ztos(id));
defer free(sid);
const spriority = strconv::ztos(t.priority);
- csv::writerecord(os::stdout, [sid, t.name, spriority])!;
+ tsv::writerecord(os::stdout, [sid, t.name, spriority])!;
};
fn printtask(t: task, id: size) (void | error) = {
@@ -155,11 +155,11 @@ fn filter(tasks: []task, a: arguments) (void | task | error) = {
};
};
-fn csv(tasks: []task, a: arguments) (void | task | error) = {
- csv::writerecord(os::stdout, ["id" ,"name", "priority"])!;
+fn tsv(tasks: []task, a: arguments) (void | task | error) = {
+ tsv::writerecord(os::stdout, ["id" ,"name", "priority"])!;
for (let i = 0z; i < len(tasks); i += 1) {
const t = tasks[i];
- printtaskcsv(t, i)?;
+ printtasktsv(t, i)?;
};
};