Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nafigator
Copy link
Contributor

@nafigator nafigator commented Apr 12, 2025

fixes #48

Also added sorting.

@ardan-bkennedy
Copy link
Collaborator

Can't we do this without the extra dependencies?

@nafigator
Copy link
Contributor Author

I would not like to write custom sorting. It adds more complexity I think. Those deps for sorting only.

@ardan-bkennedy
Copy link
Collaborator

I haven't looked at your code but the stdlib has sorting. I'll look at this during the week

@nafigator
Copy link
Contributor Author

nafigator commented Apr 12, 2025

I haven't looked at your code but the stdlib has sorting.

Thanks for the tip. It works :)
Dependencies removed.

@nafigator nafigator force-pushed the flag-desc branch 2 times, most recently from 0df231d to 736258c Compare April 12, 2025 20:35
}

// longOptInfo constructs a long option description string.
func longOptInfo(fld Field) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why add a new function when flagUsage won't be used anymore? Why not change change the flagUsage function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

flagUsage() used in writeOptions() and it's functionality contains short flags for help output. So I decided to create a new function.

But I think both flagUsage() and longOptInfo() have two responsibilities. Would be better if they provided flag info only without formatting with spaces. But may be this is idea for next PR :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I hate these PR's because it's so hard to see everything. I will have time on Friday to properly review and publish this. Thanks

@ardan-bkennedy ardan-bkennedy merged commit 54895ba into ardanlabs:master Apr 18, 2025
3 checks passed
@nafigator nafigator deleted the flag-desc branch April 18, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Short params in conf.String() output

2 participants