1
0
mirror of https://github.com/bitwarden/server synced 2026-02-18 18:33:29 +00:00
Files
server/util/DbSeederUtility/SeedArgs.cs
2026-02-17 07:42:53 +01:00

36 lines
960 B
C#

using CommandDotNet;
namespace Bit.DbSeederUtility;
/// <summary>
/// CLI argument model for the seed command.
/// Supports loading presets from embedded resources.
/// </summary>
public class SeedArgs : IArgumentModel
{
[Option('p', "preset", Description = "Name of embedded preset to load (e.g., 'dunder-mifflin-full')")]
public string? Preset { get; set; }
[Option('l', "list", Description = "List all available presets and fixtures")]
public bool List { get; set; }
[Option("mangle", Description = "Enable mangling for test isolation")]
public bool Mangle { get; set; }
public void Validate()
{
// List mode is standalone
if (List)
{
return;
}
// Must specify preset
if (string.IsNullOrEmpty(Preset))
{
throw new ArgumentException(
"--preset must be specified. Use --list to see available presets.");
}
}
}