More shorthands for hugo commands

I find myself using some commands regularly like --renderSegments and I wish more commands had shorthands e.g rs.

I suspect that what flags people use are highly subjective*. I currently rarely use --renderSegments… Not sure what OS you’re on, but setting up some shell functions as shortcut isn’t hard. Here’s one I use all the time:

function h() {
	hugo server -F -O -N -D
}
  • But looking at the current list, it looks like we added these without much thinking back in the days. A lot of the shorthands are for flags that I suspect very few uses very often. Hmm…

Keep in mind that Cobra follows the combine options without arguments. So the above is same as hugo -FOND, guess multiple char shorthands (single dash) are not supported and would be quite unexpected.

-rs and -r -s will as of now ERROR command error: unknown shorthand flag: 'r' in -rs.

hugo -sOND is same as hugo -s OND or hugo --source OND

maybe aliases for flags may be an option --rs but guess that would get confusing.

Try

hugo server -FOND

And, yea, that is shorter, I surprisingly didn’t know that.

I added a few to bash_aliases file. Nice idea.