brain-dump: merge --note into --context, single field for extra info
This commit is contained in:
parent
0352f8d04b
commit
516d6a1b34
3 changed files with 7 additions and 12 deletions
|
|
@ -43,7 +43,6 @@ function formatTask(t) {
|
|||
|
||||
function formatRecurring(r) {
|
||||
let line = `${r.id}\t${r.frequency}\t${r.when || '-'}\t${r.text}`;
|
||||
if (r.note) line += `\t${r.note}`;
|
||||
if (r.context) line += `\t${r.context}`;
|
||||
return line;
|
||||
}
|
||||
|
|
@ -93,10 +92,8 @@ function cmdAdd(args) {
|
|||
if (isRecurring) {
|
||||
const frequency = getFlag(args, '--frequency') || 'daily';
|
||||
const when = getFlag(args, '--when') || undefined;
|
||||
const note = getFlag(args, '--note') || undefined;
|
||||
const item = { id: shortId(), text, frequency };
|
||||
if (when) item.when = when;
|
||||
if (note) item.note = note;
|
||||
if (context) item.context = context;
|
||||
data.recurring = data.recurring || [];
|
||||
data.recurring.push(item);
|
||||
|
|
@ -136,10 +133,8 @@ function cmdEdit(args) {
|
|||
if (isRecurring) {
|
||||
const frequency = getFlag(args, '--frequency');
|
||||
const when = getFlag(args, '--when');
|
||||
const note = getFlag(args, '--note');
|
||||
if (frequency) item.frequency = frequency;
|
||||
if (when) item.when = when;
|
||||
if (note !== null && note !== undefined) item.note = note;
|
||||
save(data);
|
||||
console.log(`Updated recurring: ${formatRecurring(item)}`);
|
||||
} else {
|
||||
|
|
@ -246,8 +241,8 @@ switch (cmd) {
|
|||
Commands:
|
||||
list [--priority now,soon] [--due] [--limit N]
|
||||
add --text "..." --priority soon [--context "..."]
|
||||
add --recurring --text "..." --frequency daily [--when evening] [--note "..."] [--context "..."]
|
||||
edit <id> [--text "..."] [--priority|--frequency|--when|--note|--context "..."]
|
||||
add --recurring --text "..." --frequency daily [--when evening] [--context "..."]
|
||||
edit <id> [--text "..."] [--priority|--frequency|--when|--context "..."]
|
||||
done <id>
|
||||
show <id>
|
||||
nudged <id1>,<id2>,...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue