Skip to content

feat(cli)!: remove --json in favor of --format json#14061

Merged
davidpdrsn merged 1 commit into
masterfrom
dp-remove-json-flag
Jun 5, 2026
Merged

feat(cli)!: remove --json in favor of --format json#14061
davidpdrsn merged 1 commit into
masterfrom
dp-remove-json-flag

Conversation

@davidpdrsn

@davidpdrsn davidpdrsn commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Removes the global --json flag in favor of using --format json. That way, there is only one way to specify the format.

@slarse and I think not having --format as a global flag is good since it might not make sense for all commands. Instead, the commands that support format should handle it specifically. This PR doesn't change that; --format is still global, but we'll look into it later. But to move in that direction, I added

#[derive(clap::Args)]
pub struct OutputFormatArg {
    #[clap(...)]
    pub format: OutputFormat,
}

which can be #[clap(flatten)]'ed into other arg structs later. Currently, it's just used in the top-level Args type.

@github-actions github-actions Bot added rust Pull requests that update Rust code @gitbutler/web CLI The command-line program `but` labels Jun 3, 2026
@davidpdrsn davidpdrsn force-pushed the dp-remove-json-flag branch from f2daa57 to f7454d9 Compare June 3, 2026 21:02
@davidpdrsn davidpdrsn marked this pull request as ready for review June 3, 2026 21:04
Copilot AI review requested due to automatic review settings June 3, 2026 21:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@davidpdrsn davidpdrsn requested a review from krlvi June 3, 2026 21:04

@krlvi krlvi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is fine. The agents are not using the --json flag but it is still useful for scripting.
Just dont forget to update the docs http://github.com/gitbutlerapp/gitbutler-docs

@slarse

slarse commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This is fine. The agents are not using the --json flag but it is still useful for scripting. Just dont forget to update the docs http://github.com/gitbutlerapp/gitbutler-docs

We shouldn't update the docs before release, should we? Updating docs should be automated but it should never happen before release unless we have an nightly docs subdomain or similar. Which we don't?

change rewords --format flag to --fix-formatting

fix tests using short -f

fix skills and other things that mention --json

fix remaining few tests

fix tests passing --json
@davidpdrsn

Copy link
Copy Markdown
Contributor Author

I've opened gitbutlerapp/gitbutler-docs#198 which we can merge when making a new release.

@davidpdrsn davidpdrsn merged commit fc0b752 into master Jun 5, 2026
40 checks passed
@davidpdrsn davidpdrsn deleted the dp-remove-json-flag branch June 5, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` @gitbutler/web rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants