Skip to content

Conversation

@adombeck
Copy link

@adombeck adombeck commented Jan 5, 2026

The Long description was prepended to the Synopsis section which it does not belong to - the synopsis should, by convention, only be the syntax of the command and its options.

It's now added to a separate Description section.

The `Long` description was prepended to the Synopsis section which it
does not belong to - the synopsis should, by convention, only be the
syntax of the command and its options.

It's now added to a separate Description section.
@CLAassistant
Copy link

CLAassistant commented Jan 5, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/docs-generation Generation of docs via Cobra label Jan 5, 2026
@adombeck
Copy link
Author

adombeck commented Jan 5, 2026

I can add a test if you agree with the change.

}

if cmd.Runnable() {
if len(cmd.Long) > 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this only be printed if long > 0 now?

Copy link
Author

@adombeck adombeck Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was already the case. The ### Synopsis section header was previously printed in line 67, which was only printed if len(cmd.Long) > 0.

Copy link
Collaborator

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some kind of reference as to why we should use the new format you suggest? I don’t want someone to come along later with a different opinion to challenge this change.

@adombeck
Copy link
Author

adombeck commented Jan 5, 2026

Can you provide some kind of reference as to why we should use the new format you suggest?

My reasoning is that the synopsis should only contain the formal description of how to run the command and what command line options it takes (e.g. lxc launch [<remote>:]<image> [<remote>:][<name>] [flags]). That's the convention for man pages and POSIX utility descriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs-generation Generation of docs via Cobra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants