Skip to content

--quiet is not usable as a global option with gitea web #22361

@mqudsi

Description

@mqudsi

Description

Per gitea --help, the correct order of arguments is as follows:

gitea [global options] command [command options] [arguments...]

and the global options list includes

GLOBAL OPTIONS:
   ...
   --quiet, -q                    Only display Fatal logging errors until logging is set-up
   --verbose                      Set initial logging to TRACE level until logging is properly set-up

However, executing gitea -q web does not work (the initial logger level is still Info rather than Fatal) while gitea web -q does work.

It seems quiet is actually defined as a subcommand-specific cli boolean flag in web.go for the web subcommand associated with the runWeb action:

gitea/cmd/web.go

Lines 51 to 53 in d42b52f

cli.BoolFlag{
Name: "quiet, q",
Usage: "Only display Fatal logging errors until logging is set-up",

I'd file a PR but I'm not clear on the intended behavior. It seems that the concept of global options might be altogether incorrect here since the switch is defined for a specific command and in runWeb the context associated with that particular command is queried for quiet, so it seems like you might prefer that the output/organization of gitea --help be patched rather than the actual querying behavior. I'm not sure if --quiet was previously a global option and now it's a command-specific one or if it's really only meant when running gitea -q rather than gitea -q web.

Gitea Version

1.19.0+dev-43-g57df0f116

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

N/A

Operating System

FreeBSD

How are you running Gitea?

Self-hosted, from the command-line.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions