1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/// The command list `jeans` prints when it doesn't know the command.
pub const USAGE: &str = "\
usage: jeans <command> [args] [--goal NAME] [--color WHEN]

  init TITLE --goal NAME [-m BODY] [--team N] [--home DIR]
                                                 make the goal commit
  add TITLE [-m BODY] [--before TASK] [--after TASK]...
                                                 insert a task before TASK (default: the goal)
  ready                                          list ready task IDs
  log [VIEW]                                     jj log of the tasks, each with its state; VIEW is one of
                                                   ready, claimed, blocked, done, open (not done),
                                                   under TASK (TASK and what feeds it),
                                                   path TASK (TASK up to the goal), or a revset
  status                                         same as log with no VIEW
  tree [TASK] [--depth N]                        an outline from TASK (default: the goal) down,
                                                   collapsing done subtrees and anything past N levels
  board [TASK]                                   one section per state, for TASK and what feeds it
  watch [tree|board] [TASK] [--depth N]          redraw tree (the default) or board whenever the graph changes
  show TASK                                      a task's state, workspace, and description
  describe TASK -m MESSAGE                       replace a task's description
  claim TASK                                     make TASK's workspace; prints its path
  done TASK -m MESSAGE                           squash the workspace in, prepend MESSAGE to the
                                                   task's description, mark done, drop it
  release TASK                                   squash the workspace in and drop it, not done
  team-size                                      how many developers may run at once
  guide stakeholder|developer                    print the stakeholder's or developer's guide

--goal NAME picks the goal. Without it, a command uses the goal its TASK
feeds, then the goal the current workspace's task feeds, then the repo's
only goal.

--color WHEN is always, never, or auto (the default), which colors output
only when it goes to a terminal and NO_COLOR is unset.
";

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn usage_lists_every_command() {
        for command in [
            "init",
            "add",
            "ready",
            "log",
            "status",
            "tree",
            "board",
            "watch",
            "show",
            "describe",
            "claim",
            "done",
            "release",
            "team-size",
            "guide",
        ] {
            assert!(
                USAGE.contains(&format!("\n  {command}")),
                "missing {command}"
            );
        }
    }
}