| 123 | /// - `--no-recursive`: Don't recursively add directory contents |
| 124 | #[derive(Parser, Debug)] |
| 125 | pub struct Add { |
| 126 | /// Files or directories to add to tracking. |
| 127 | /// |
| 128 | /// Paths can be relative or absolute. Directories will be added |
| 129 | /// recursively by default. |
| 130 | #[arg(value_name = "FILES", required_unless_present = "all")] |
| 131 | pub files: Vec<String>, |
| 132 | |
| 133 | /// Add all untracked files in the repository. |
| 134 | /// |
| 135 | /// This is equivalent to running `atomic status` to find untracked files |
| 136 | /// and then adding them all. Use with caution in large repositories. |
| 137 | #[arg(short = 'A', long = "all", conflicts_with = "files")] |
| 138 | pub all: bool, |
| 139 | |
| 140 | /// Dry run - show what would be added without doing it. |
| 141 | /// |
| 142 | /// When enabled, displays the files that would be added but doesn't |
| 143 | /// actually modify the repository. Useful for previewing changes. |
| 144 | #[arg(short = 'n', long = "dry-run")] |
| 145 | pub dry_run: bool, |
| 146 | |
| 147 | /// Force add ignored files. |
| 148 | /// |
| 149 | /// By default, files matching ignore patterns are skipped. Use this |
| 150 | /// flag to add them anyway. |
| 151 | #[arg(short = 'f', long = "force")] |
| 152 | pub force: bool, |
| 153 | |
| 154 | /// Recursively add directory contents. |
| 155 | /// |
| 156 | /// When adding a directory, also add all files within it. |
| 157 | /// This is the default behavior. |
| 158 | #[arg(short = 'r', long = "recursive", default_value = "true")] |
| 159 | pub recursive: bool, |
| 160 | |
| 161 | /// Don't recursively add directory contents. |
| 162 | /// |
| 163 | /// When adding a directory, only add the directory itself, |
| 164 | /// not its contents. |
| 165 | #[arg(long = "no-recursive", conflicts_with = "recursive")] |
| 166 | pub no_recursive: bool, |
| 167 | |
| 168 | /// Track empty directories explicitly. |
| 169 | /// |
| 170 | /// By default, Atomic only tracks files (directories are created implicitly |
| 171 | /// when needed). Use this flag to explicitly track empty directories. |
| 172 | /// |
| 173 | /// Unlike Git (which requires `.keep` files), Atomic supports tracking |
| 174 | /// empty directories as first-class citizens in the repository graph. |
| 175 | /// |
| 176 | /// # Example |
| 177 | /// |
| 178 | /// ```text |
| 179 | /// $ atomic add --directory src/empty_module/ |
| 180 | /// Adding directory: src/empty_module/ |
| 181 | /// ✓ Added 1 directory |
| 182 | /// ``` |
nothing calls this directly
no outgoing calls
no test coverage detected