celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

cmd/cli: review usage string to comply with Utility Argument Syntax

Open Wondertan opened this issue 3 years ago • 4 comments

Something that we overlooked during review processes before for our CLIs. We should conform to https://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap12.html#tag_12_01.

Wondertan avatar Oct 26 '23 15:10 Wondertan

Realized this after looking at #2872

Wondertan avatar Oct 26 '23 15:10 Wondertan

We might be interested into reviewing our flag params and making them better.

cristaloleg avatar Jan 21 '25 13:01 cristaloleg

I'd like to take this. I propose first inventorying the current Cobra Use/Args definitions against POSIX Utility Syntax Guidelines, then submitting a focused PR that corrects usage strings without changing command behavior and adds/updates help-output tests where available. I will keep unrelated wording cleanup out of scope; if the audit is large, I will split it by command group rather than send one mechanical repository-wide diff.

loglapa avatar Sep 03 '26 17:09 loglapa

During the audit I found one behavioral mismatch worth calling out before finalizing: delegate and undelegate advertise and consume two operands, but still use cobra.ExactArgs(4). Git history shows those counts were left behind when fee and gas were moved from positional arguments into TxConfig flags in #3349; sibling commands were updated then, but these two were missed.

A truthful POSIX usage string therefore requires changing both validators to ExactArgs(2). I propose including that narrowly scoped fix with regression coverage, while keeping every other command behavior unchanged. Please let me know if you would rather have that mismatch split into a separate PR.

loglapa avatar Sep 03 '26 18:09 loglapa