Skip to content

Commit daab5d5

Browse files
committed
feat(mcl.commands.add_task): add help for add_task
1 parent 8651633 commit daab5d5

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

packages/mcl/src/main.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import std.logger : infof, errorf, LogLevel;
55

66
import mcl.utils.path : rootDir;
77
import mcl.utils.tui : bold;
8-
98
import cmds = mcl.commands;
109

1110
alias supportedCommands = imported!`std.traits`.AliasSeq!(
@@ -73,8 +72,11 @@ int wrongUsage(string error)
7372
{
7473
writefln("Error: %s.", error);
7574
writeln("Usage:\n");
76-
static foreach (cmd; supportedCommands)
75+
static foreach (cmd; supportedCommands) {
7776
writefln(" mcl %s", __traits(identifier, cmd));
78-
77+
static if (__traits(identifier, cmd) == "add_task") {
78+
cmds.writeAddTaskHelp();
79+
}
80+
}
7981
return 1;
8082
}

packages/mcl/src/src/mcl/commands/package.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ public import mcl.commands.shard_matrix : shard_matrix;
77
public import mcl.commands.ci : ci;
88
public import mcl.commands.host_info : host_info;
99
public import mcl.commands.machine_create : machine_create;
10-
public import mcl.commands.add_task : add_task;
10+
public import mcl.commands.add_task : add_task, writeAddTaskHelp;

packages/mcl/src/src/mcl/utils/add_task.d

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export void add_task(string[] args)
2020
if (i < 2) {
2121
continue; // ignore mcl and `add_task` command args
2222
}
23+
else if (arg == "--help")
24+
{
25+
writeAddTaskHelp();
26+
return;
27+
}
2328
else if (i == 2)
2429
{
2530
taskManager.params.taskName = arg;
@@ -34,6 +39,27 @@ export void add_task(string[] args)
3439
taskManager.addTaskToCoda();
3540
}
3641

42+
export void writeAddTaskHelp() {
43+
writeln(" mcl add_task <task-title> [<username/priority/status/milestone/estimate/tshirt-size> ..]");
44+
writeln(" <username> is `@<name>` (might be a shorter name if registered in mcl_config.json)");
45+
writeln(" <priority> is highest / high / normal / low");
46+
writeln(" <status> is backlog / ready (for ready to start) / progress (for in progress) / done / blocker / paused / cancelled");
47+
writeln(" <milestone> is project-specific, but can be auto-recognized based on shorter names in mcl_config.json");
48+
writeln(" <estimate> is time(days) estimate, needs explicit `--estimate=..` for now");
49+
writeln(" <tshirt-size> is S / M / L / XL");
50+
writeln("");
51+
writeln(" for all you can also pass explicit flag like `--priority=<value>");
52+
writeln("");
53+
writeln(" examples (with a hypothetical mcl_config.json):");
54+
writeln(" mcl add_task \"test task\" @Paul low progress beta M");
55+
writeln(" mcl add_task \"test task 2\" @Paul v1 L");
56+
writeln(" mcl add_task \"test task 3\" @John done normal M beta");
57+
writeln(" mcl add_task \"test task 4\" M backlog @John");
58+
writeln(" mcl add_task \"test task 5\"");
59+
writeln(" mcl add_task \"test task 6\" @Paul --priority=low backlog");
60+
writeln(" mcl add_task \"test task 7\" @Paul --priority=low --status=backlog");
61+
}
62+
3763
struct TaskConfig {
3864
string codaApiToken;
3965
string[string] userNames;

0 commit comments

Comments
 (0)