gitwrap/add/
options.rs

1// Warning!! Code generated automatically: this file must not be edited by hand
2use crate::option_arg;
3use crate::wrap_command::FnOptionArg;
4
5pub const DRY_RUN: &str = "--dry-run";
6pub const VERBOSE: &str = "--verbose";
7pub const FORCE: &str = "--force";
8pub const INTERACTIVE: &str = "--interactive";
9pub const PATCH: &str = "--patch";
10pub const EDIT: &str = "--edit";
11pub const UPDATE: &str = "--update";
12pub const ALL: &str = "--all";
13pub const NO_ALL: &str = "--no-all";
14pub const INTENT_TO_ADD: &str = "--intent-to-add";
15pub const REFRESH: &str = "--refresh";
16pub const IGNORE_ERRORS: &str = "--ignore-errors";
17pub const IGNORE_MISSING: &str = "--ignore-missing";
18pub const HYPHEN_HYPHEN: &str = "--";
19
20/// Don't actually add the file(s), just show if they exist and/or will be ignored.
21/// -n, --dry-run
22pub fn dry_run() -> FnOptionArg {
23    option_arg::simple(DRY_RUN)
24}
25
26/// Be verbose.
27/// -v, --verbose
28pub fn verbose() -> FnOptionArg {
29    option_arg::simple(VERBOSE)
30}
31
32/// Allow adding otherwise ignored files.
33/// -f, --force
34pub fn force() -> FnOptionArg {
35    option_arg::simple(FORCE)
36}
37
38/// Add modified contents in the working tree interactively to the index.
39/// Optional path arguments may be supplied to limit operation to a subset of the working tree.
40/// See 'Interactive mode' for details.
41/// -i, --interactive
42pub fn interactive() -> FnOptionArg {
43    option_arg::simple(INTERACTIVE)
44}
45
46/// Interactively choose hunks of patch between the index and the work tree and add them to the index.
47/// This gives the user a chance to review the difference before adding modified contents to the index.
48/// This effectively runs add --interactive, but bypasses the initial command menu and directly jumps to the patch subcommand.
49/// See “Interactive mode” for details.
50/// -p, --patch
51pub fn patch() -> FnOptionArg {
52    option_arg::simple(PATCH)
53}
54
55/// Open the diff vs.
56/// the index in an editor and let the user edit it.
57/// After the editor was closed, adjust the hunk headers and apply the patch to the index.
58/// The intent of this option is to pick and choose lines of the patch to apply, or even to modify the contents of lines to be staged.
59/// This can be quicker and more flexible than using the interactive hunk selector.
60/// However, it is easy to confuse oneself and create a patch that does not apply to the index.
61/// See EDITING PATCHES below.
62/// -e, --edit
63pub fn edit() -> FnOptionArg {
64    option_arg::simple(EDIT)
65}
66
67/// Update the index just where it already has an entry matching <pathspec>.
68/// This removes as well as modifies index entries to match the working tree, but adds no new files.
69/// If no <pathspec> is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
70/// -u, --update
71pub fn update() -> FnOptionArg {
72    option_arg::simple(UPDATE)
73}
74
75/// Update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry.
76/// This adds, modifies, and removes index entries to match the working tree.
77/// If no <pathspec> is given when -A option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
78/// -A, --all, --no-ignore-removal
79pub fn all() -> FnOptionArg {
80    option_arg::simple(ALL)
81}
82
83/// Update the index by adding new files that are unknown to the index and files modified in the working tree, but ignore files that have been removed from the working tree.
84/// This option is a no-op when no <pathspec> is used.
85/// This option is primarily to help users who are used to older versions of Git, whose 'git add <pathspec>...' was a synonym for 'git add --no-all <pathspec>...', i.e.
86/// ignored removed files.
87/// --no-all, --ignore-removal
88pub fn no_all() -> FnOptionArg {
89    option_arg::simple(NO_ALL)
90}
91
92/// Record only the fact that the path will be added later.
93/// An entry for the path is placed in the index with no content.
94/// This is useful for, among other things, showing the unstaged content of such files with git diff and committing them with git commit -a.
95/// -N, --intent-to-add
96pub fn intent_to_add() -> FnOptionArg {
97    option_arg::simple(INTENT_TO_ADD)
98}
99
100/// Don't add the file(s), but only refresh their stat() information in the index.
101/// --refresh
102pub fn refresh() -> FnOptionArg {
103    option_arg::simple(REFRESH)
104}
105
106/// If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.
107/// The command shall still exit with non-zero status.
108/// The configuration variable add.ignoreErrors can be set to true to make this the default behaviour.
109/// --ignore-errors
110pub fn ignore_errors() -> FnOptionArg {
111    option_arg::simple(IGNORE_ERRORS)
112}
113
114/// This option can only be used together with --dry-run.
115/// By using this option the user can check if any of the given files would be ignored, no matter if they are already present in the work tree or not.
116/// --ignore-missing
117pub fn ignore_missing() -> FnOptionArg {
118    option_arg::simple(IGNORE_MISSING)
119}
120
121/// This option can be used to separate command-line options from the list of files, (useful when filenames might be mistaken for command-line options)
122/// --
123pub fn hyphen_hyphen() -> FnOptionArg {
124    option_arg::simple(HYPHEN_HYPHEN)
125}
126
127/// Files to add content from.
128/// Fileglobs (e.g.
129/// *.c) can be given to add all matching files.
130/// Also a leading directory name (e.g.
131/// dir to add dir/file1 and dir/file2) can be given to update the index to match the current state of the directory as a whole (e.g.
132/// specifying dir will record not just a file dir/file1 modified in the working tree, a file dir/file2 added to the working tree, but also a file dir/file3 removed from the working tree).
133/// Note that older versions of Git used to ignore removed files; use --no-all option if you want to add modified or new files but ignore removed ones.
134/// <pathspec>
135pub fn pathspec(pathspec: &str) -> FnOptionArg {
136    option_arg::value_parameter(pathspec)
137}