// file      : bpkg/rep-create.cli
// license   : MIT; see accompanying LICENSE file

include <bpkg/common.cli>;

"\section=1"
"\name=bpkg-rep-create"
"\summary=create repository"

namespace bpkg
{
  {
    "<options> <dir>",

    "\h|SYNOPSIS|

     \c{\b{bpkg rep-create} [<options>] [<dir>]}

     \h|DESCRIPTION|

     The \cb{rep-create} command regenerates the \cb{packages.manifest} file
     based on the files present in the repository directory. If the
     \cb{repositories.manifest} file contains a certificate, then the
     \cb{signature.manifest} file is regenerated as well. In this case the
     \cb{--key} option must be used to specify the certificate's private
     key. If <dir> is not specified, then the current working directory is
     used as the repository root."
  }

  class rep_create_options: common_options
  {
    "\h|REP-CREATE OPTIONS|"

    bool --ignore-unknown
    {
      "Ignore unknown manifest entries. Note that this option also ignores the
       version constraints in the special toolchain build-time dependencies."
    }

    butl::standard_version --min-bpkg-version
    {
      "<ver>",
      "Apply backward compatibility workarounds to the generated
       \cb{packages.manifest} file so that it can be consumed by \cb{bpkg}
       versions greater or equal to the specified version. If unspecified,
       then the \cb{min-bpkg-version} value from the \cb{repositories.manifest}
       file is used, if present. If the manifest value is not specified
       either, then no backward compatibility workarounds are applied."
    }

    string --key
    {
      "<name>",
      "Private key to use to sign the repository. In most cases <name> will
       be a path to the key file but it can also be a key id when a custom
       \cb{openssl} cryptographic engine is used."
    }
  };

  "
   \h|DEFAULT OPTIONS FILES|

   See \l{bpkg-default-options-files(1)} for an overview of the default
   options files. For the \cb{rep-create} command the search start
   directory is the repository directory. The following options files are
   searched for in each directory and, if found, loaded in the order listed:

   \
   bpkg.options
   bpkg-rep-create.options
   \

   The following \cb{rep-create} command options cannot be specified in the
   remote default options files:

   \
   --key
   \
  "
}
