Commit cedfb49
authored
fix(generate): Correct help text for push flag (#1908)
Updates help text to refer to the correct '-push' flag instead of the
non-existent '-push-config'.
Fixes #1726
With this fix, `go run ./cmd/librarian generate -h` shows:
```
jinseop@jinseop:/workspace/librarian$ go run ./cmd/librarian generate -h
Specify the API repository root and the path within it for the API to generate.
Optional flags can be specified to use a non-default language repository, and to indicate whether or not
to build the generated library.
The generate command handles both onboarding new libraries and regenerating existing ones.
The behavior is determined by the provided flags.
**Onboarding a new library:**
To configure and generate a new library, specify both the "-api" and "-library" flags. This process involves:
1. Running the "configure" command in the language container to set up the repository.
2. Adding the new library's configuration to the ".librarian/state.yaml" file.
3. Proceeding with the generation steps below.
**Regenerating existing libraries:**
If only "-api" or "-library" is specified, the command regenerates that single, existing library.
If neither flag is provided, it regenerates all libraries listed in ".librarian/state.yaml".
The generation process for an existing library involves delegating to the language container's
'generate' command. After generation, the tool cleans the destination directory and copies the
new files into place, according to the configuration in '.librarian/state.yaml'.
If the '--build' flag is specified, the 'build' command is also executed.
**Output:**
After generation, if the "-push" flag is provided, the changes are committed to a new branch, and
a pull request is created. Otherwise, the changes are left in the local working tree for
inspection.
Usage:
librarian generate -source=<api-root> -api=<api-path> [flags]
Flags:
-api string
path to the API to be configured/generated (e.g., google/cloud/functions/v2)
-api-source string
location of googleapis repository. If undefined, googleapis will be cloned to the output
-branch string
remote branch to use with the code repository for cloning and pull requests. (default "main")
-build
whether to build the generated code
-host-mount string
a mount point from Docker host and within the Docker. The format is {host-dir}:{local-dir}.
-image string
Container image to run for subcommands. Defaults to the image in the pipeline state.
-library string
The ID of a single library to update. This is repo-specific and defined in the state.yaml
-output string
Working directory root. When this is not specified, a working directory will be created in /tmp.
-push
whether to push the generated code
-repo string
Code repository where the generated code will reside.
Can be a remote in the format of a remote URL such as
https://github.com/{owner}/{repo} or a local file path like
/path/to/repo. Both absolute and relative paths are supported.
If not specified, will try to detect if the current working
directory is configured as a language repository.
2025/09/03 12:26:47 flag: help requested
exit status 1
```1 parent af7b19e commit cedfb49
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments