// file      : bdep/project.cli
// license   : MIT; see accompanying LICENSE file

include <bdep/common.cli>;

"\name=project" // Not a man page.

namespace bdep
{
  // Common options for commands that add/create configurations.
  //
  class configuration_add_options
  {
    string --type|--config-type = "target"
    {
      "<typ>",
      "The type of the configuration being created. By default, configuration
       of type \cb{target} is created. See \l{bpkg-cfg-create(1)} for
       background on configuration types."
    }

    bool --default
    {
      "Make the added or created configuration the default."
    }

    bool --no-default
    {
      "Don't make the first added or created configuration the default."
    }

    bool --forward
    {
      "Make the added or created configuration forwarded."
    }

    bool --no-forward
    {
      "Don't make the added or created configuration forwarded."
    }

    bool --auto-sync
    {
      "Make the added or created configuration automatically synchronized."
    }

    bool --no-auto-sync
    {
      "Don't make the added or created configuration automatically
       synchronized."
    }

    // These two a really just convenience aliases since they can be specified
    // as part of <cfg-args> but would require `--`, for example:
    //
    // bdep ... -- --wipe cc config.cxx=g++

    bool --existing|-e
    {
      "Initialize a \cb{bpkg} configuration based on an existing build system
       configuration."
    }

    bool --wipe
    {
      "Wipe the configuration directory clean before creating the new
       configuration."
    }
  };

  // Common options for commands that accept --config-id and @<cfg-name>.
  //
  class configuration_name_options: common_options
  {
    // Note that this is also used as storage for configuration names
    // specified as @<name>.
    //
    vector<pair<string, size_t>> --config-name|-n
    {
      "<name>",
      "Specify the build configuration as a name."
    };

    vector<pair<uint64_t, size_t>> --config-id
    {
      "<num>",
      "Specify the build configuration as an id."
    };
  };

  // Common options for commands that operate on project/packages (prj-spec
  // and pkg-spec) and configurations (cfg-spec).
  //
  class project_options: configuration_name_options
  {
    bool --all|-a
    {
      "Use all build configurations."
    }

    vector<pair<dir_path, size_t>> --config|-c
    {
      "<dir>",
      "Specify the build configuration as a directory."
    }

    dir_paths --directory|-d
    {
      "<dir>",
      "Assume project/package is in the specified directory rather than in the
       current working directory."
    }
  };
}
