From: Stefan Sperling Subject: Re: tog(1) log by default++ To: Martin Pieuchot , gameoftrees@openbsd.org Date: Fri, 14 Feb 2020 17:15:32 +0100 On Fri, Feb 14, 2020 at 04:59:32PM +0100, Stefan Sperling wrote: > On Fri, Feb 14, 2020 at 04:39:48PM +0100, Martin Pieuchot wrote: > > If the second argument on the command line doesn't match a command name > > let the tool to assume it's a path. In other words the following: > > > > $ tog kern/kern_sync.c > > > > Becomes an alias for: > > > > $ tog log kern/kern_sync.c > > > > This is similar to what tig(1) does and it helps me being lazy :o) > > This behaviour already existed once and was reverted in > commit 3642c4c6513e3536dc77e8f2b7a2402d1aa916a7 > > I don't recall why I reverted it. I suspect it was to keep the > 'command subcommand' syntax consistent across both got(1) and tog(1). > And I didn't like the old implementation I had, but yours looks cleaner. One problem is that 'tog foo' for non-existent foo no longer shows usage information. It says "tog: no git repository found" or "tog: no such entry found in tree" depending on the contents of the current working directory, without any further hints. Perhaps a custom error message could be added which says something like "tog: 'foo' is neither a known command nor a path" when it fails, followed by usage info?