Skip to content

Improve CLI commands #34973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 10, 2025
Merged

Improve CLI commands #34973

merged 17 commits into from
Jul 10, 2025

Conversation

TheFox0x7
Copy link
Contributor

add makefile rule for shell completions, disable internal commands from showing in help
rework custom help so it only triggers on first level commands


help changes are mainly to work around regression: #34510 (comment)

TheFox0x7 added 8 commits July 3, 2025 23:03
since flags aren't marked as local they cascade through the app so
before can be used as setup as we need to define flags once.
only main and it's subcommands are directly handled by it
instead of looping though the flags in linage, use their non local
property
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 6, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/internal labels Jul 6, 2025
@silverwind silverwind changed the title add genereted completions for shells add generated completions for shells Jul 7, 2025
@lunny lunny added this to the 1.25.0 milestone Jul 9, 2025
work-path first, then config, then custom path
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 9, 2025
@wxiaoguang wxiaoguang changed the title add generated completions for shells Improve CLI commands Jul 10, 2025
@wxiaoguang
Copy link
Contributor

Made more improvements to the "help" command/flag and added some tests. Does it look good to you?

@wxiaoguang wxiaoguang added the type/enhancement An improvement of existing functionality label Jul 10, 2025
@TheFox0x7
Copy link
Contributor Author

It does. With that test rework we could add Validation func to this to check early if the file exists or is what it should be. Not sure if this something we want to add or not though.

I've also been thinking about adding a dedicated config subcommand which would all end user to dump either the currently loaded config or one that would get loaded on init, which potentially would allow later addition of config migrate between releases and would negate the need for Default Config section. But that's for a different time, with it's own proposal and as companion to settings rework so just throwing it out there.

@wxiaoguang
Copy link
Contributor

IMO the "DEFAULT CONFIGURATION:" section is just a legacy design that we don't want to break (at the moment it is the only approach to see where the config file is, for example: in docker, there is a shell wrapper)

As long as there is no breaking, we can still keep "DEFAULT CONFIGURATION:" section for some time, until we would have some better designs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 10, 2025
@wxiaoguang wxiaoguang merged commit 4b174e4 into go-gitea:main Jul 10, 2025
26 checks passed
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 11, 2025
* giteaofficial/main:
  Fix updating user visibility (go-gitea#35036)
  Fix git commit committer parsing and add some tests (go-gitea#35007)
  Refactor OpenIDConnect to support SSH/FullName sync (go-gitea#34978)
  Support base64-encoded agit push options (go-gitea#35037)
  Also display "recently pushed branch" alert on PR view (go-gitea#35001)
  Make submodule link work with relative path (go-gitea#35034)
  Update to go 1.24.5 (go-gitea#35031)
  Improve CLI commands (go-gitea#34973)
  Tweak eslint config, fix new issues (go-gitea#35019)

# Conflicts:
#	templates/repo/commits_list.tmpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/go Pull requests that update Go code modifies/internal type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants