main: rename basedir -> base-dir

Rename the `basedir` argument to be consistent with `output-dir`
by hyphenation.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
Simon de Vlieger 2025-02-26 20:12:07 +01:00 committed by Michael Vogt
parent 2e741a70ad
commit 58aa0cf87b
3 changed files with 10 additions and 10 deletions

View file

@ -14,7 +14,6 @@ json
osbuild
qcow
UEFI
datadir
copr
SBOM
SBOMs
@ -36,3 +35,4 @@ hyperscalers
weldr
libc
url
dir

View file

@ -199,7 +199,7 @@ to the installed image but are not used at build time to install third-party
packages.
To change repositories during image build time the command line options
`--datadir`, `--extra-repo` and `--force-repo` can be used. The repositories
`--data-dir`, `--extra-repo` and `--force-repo` can be used. The repositories
there will only added during build time and will not be available in the
installed system (use the above blueprint options if that the goal).
@ -207,9 +207,9 @@ Note that both options are targeting advanced users/use-cases and when
used wrongly can result in failing image builds or non-booting
systems.
## Using the datadir switch
## Using the data-dir switch
When using the `--datadir` flag `image-builder` will look into
When using the `--data-dir` flag `image-builder` will look into
the <datadir>/repositories directory for a file called <distro>.json
that contains the repositories for the <distro>.
@ -246,9 +246,9 @@ A: The osbuild binary is used to actually build the images but beyond that
Q: Can I have custom repository files?
A: Sure! The repositories are encoded in json in "<distro>-<vesion>.json",
files, e.g. "fedora-41.json". See these [examples](https://github.com/osbuild/images/tree/main/data/repositories). Use the "--datadir" switch and
files, e.g. "fedora-41.json". See these [examples](https://github.com/osbuild/images/tree/main/data/repositories). Use the "--data-dir" switch and
place them under "repositories/name-version.json", e.g. for:
"--datadir ~/my-project --distro foo-1" a json file must be put under
"--data-dir ~/my-project --distro foo-1" a json file must be put under
"~/my-project/repositories/foo-1.json.
Q: What is the relation to [bootc-image-builder](https://github.com/osbuild/bootc-image-builder)?

View file

@ -41,7 +41,7 @@ func cmdListImages(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
dataDir, err := cmd.Flags().GetString("datadir")
dataDir, err := cmd.Flags().GetString("data-dir")
if err != nil {
return err
}
@ -79,7 +79,7 @@ func ostreeImageOptions(cmd *cobra.Command) (*ostree.ImageOptions, error) {
}
func cmdManifestWrapper(pbar progress.ProgressBar, cmd *cobra.Command, args []string, w io.Writer, archChecker func(string) error) (*imagefilter.Result, error) {
dataDir, err := cmd.Flags().GetString("datadir")
dataDir, err := cmd.Flags().GetString("data-dir")
if err != nil {
return nil, err
}
@ -284,7 +284,7 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
func cmdDescribeImg(cmd *cobra.Command, args []string) error {
// XXX: boilderplate identical to cmdManifest() above
dataDir, err := cmd.Flags().GetString("datadir")
dataDir, err := cmd.Flags().GetString("data-dir")
if err != nil {
return err
}
@ -327,7 +327,7 @@ Image-builder builds operating system images for a range of predefined
operating systems like Fedora, CentOS and RHEL with easy customizations support.`,
SilenceErrors: true,
}
rootCmd.PersistentFlags().String("datadir", "", `Override the default data directory for e.g. custom repositories/*.json data`)
rootCmd.PersistentFlags().String("data-dir", "", `Override the default data directory for e.g. custom repositories/*.json data`)
rootCmd.PersistentFlags().StringArray("extra-repo", nil, `Add an extra repository during build (will *not* be gpg checked and not be part of the final image)`)
rootCmd.PersistentFlags().StringArray("force-repo", nil, `Override the base repositories during build (these will not be part of the final image)`)
rootCmd.PersistentFlags().String("output-dir", "", `Put output into the specified directory`)