Skip to content
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

Print help message when command is triggered with no flags #11170

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

roshanavand
Copy link
Contributor

This PR aims to fix this issue.

Starting from release v0.112.0 and via this commit, import, new, convert, list and gen commands produce no output when triggered with no flags.

This PR reverts to the old behaviour by printing the help message by default.

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2023

CLA assistant check
All committers have signed the CLA.

@@ -110,6 +110,7 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.`
cmd.PersistentFlags().StringVarP(&c.outputDir, "output", "o", "", "filesystem path to write files to")
cmd.PersistentFlags().BoolVar(&c.unsafe, "unsafe", false, "enable less safe operations, please backup first")

cmd.RunE = nil
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain the code above? I don't see the relevance to the issue title ...

@deining
Copy link
Contributor

deining commented Jun 28, 2023

I can confirm that the fix is effective and resolves #11165 .

@bep
Copy link
Member

bep commented Jun 28, 2023

OK, thanks. I see it now.

@bep bep merged commit 1264675 into gohugoio:master Jun 28, 2023
7 checks passed
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command 'hugo convert' with no arguments: silent exit instead of command synopsis
4 participants