Download raw body.
tog: print list of commands on invalid command
On Wed, Nov 19, 2025 at 10:18:29AM +0000, Johannes Thyssen Tishman wrote:
> As per the commit message, this commit makes tog behavior consistent
> with got's when running 'got -h invalid-cmd'.
ok by me.
> M tog/tog.c | 6+ 2-
>
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> commit - 414e93f1fc65b3df23c8fbaeaa334ffdab1f75b1
> commit + c11685c3bcf6c3d238b53fd7e0ee60d1e948f0ed
> blob - d3ec8991a224394ba68fc8cf5feb7f2fabeae71b
> blob + 4c1fc3471c49895d43f6f63a0f12edecececdcd2
> --- tog/tog.c
> +++ tog/tog.c
> @@ -11763,8 +11763,12 @@ main(int argc, char *argv[])
> tog_base_commit.marker = GOT_WORKTREE_STATE_UNKNOWN;
>
> if (cmd == NULL) {
> - if (argc != 1)
> - usage(0, 1);
> + if (argc > 0) {
> + fprintf(stderr, "%s: unknown command '%s'\n",
> + getprogname(), argv[0]);
> + list_commands(stderr);
> + exit(1);
> + }
> /* No command specified; try log with a path */
> error = tog_log_with_path(argc, argv);
> } else {
>
>
tog: print list of commands on invalid command