gitwrap/config/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 GLOBAL: &str = "--global";
6pub const SYSTEM: &str = "--system";
7pub const LOCAL: &str = "--local";
8pub const FILE: &str = "--file";
9pub const BLOB: &str = "--blob";
10pub const LIST: &str = "--list";
11pub const BOOL: &str = "--bool";
12pub const INT: &str = "--int";
13pub const BOOL_OR_INT: &str = "--bool-or-int";
14pub const PATH: &str = "--path";
15pub const NULL: &str = "--null";
16pub const NAME_ONLY: &str = "--name-only";
17pub const SHOW_ORIGIN: &str = "--show-origin";
18pub const EDIT: &str = "--edit";
19
20/// For writing options: write to global ~/.gitconfig file rather than the repository .git/config, write to $XDG_CONFIG_HOME/git/config file if this file exists and the ~/.gitconfig file doesn’t.
21/// --global
22pub fn global() -> FnOptionArg {
23 option_arg::simple(GLOBAL)
24}
25
26/// For writing options: write to system-wide $(prefix)/etc/gitconfig rather than the repository .git/config.
27/// --system
28pub fn system() -> FnOptionArg {
29 option_arg::simple(SYSTEM)
30}
31
32/// For writing options: write to the repository .git/config file.
33/// This is the default behavior.
34/// --local
35pub fn local() -> FnOptionArg {
36 option_arg::simple(LOCAL)
37}
38
39/// Use the given config file instead of the one specified by GIT_CONFIG.
40/// -f <config-file>, --file <config-file>
41pub fn file(config_file_arg: &str) -> FnOptionArg {
42 option_arg::with_parameter(FILE, config_file_arg)
43}
44
45/// Similar to --file but use the given blob instead of a file.
46/// E.g.
47/// you can use master:.gitmodules to read values from the file .gitmodules in the master branch.
48/// --blob <blob>
49pub fn blob(blob_arg: &str) -> FnOptionArg {
50 option_arg::with_parameter(BLOB, blob_arg)
51}
52
53/// List all variables set in config file, along with their values.
54/// -l, --list
55pub fn list() -> FnOptionArg {
56 option_arg::simple(LIST)
57}
58
59/// git config will ensure that the output is 'true' or 'false'
60/// --bool
61pub fn bool() -> FnOptionArg {
62 option_arg::simple(BOOL)
63}
64
65/// git config will ensure that the output is a simple decimal number.
66/// An optional value suffix of k, m, or g in the config file will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.
67/// --int
68pub fn int() -> FnOptionArg {
69 option_arg::simple(INT)
70}
71
72/// git config will ensure that the output matches the format of either --bool or --int, as described above.
73/// --bool-or-int
74pub fn bool_or_int() -> FnOptionArg {
75 option_arg::simple(BOOL_OR_INT)
76}
77
78/// git-config will expand leading ~ to the value of $HOME, and ~user to the home directory for the specified user.
79/// This option has no effect when setting the value (but you can use git config bla ~/ from the command line to let your shell do the expansion).
80/// --path
81pub fn path() -> FnOptionArg {
82 option_arg::simple(PATH)
83}
84
85/// For all options that output values and/or keys, always end values with the null character (instead of a newline).
86/// Use newline instead as a delimiter between key and value.
87/// This allows for secure parsing of the output without getting confused e.g.
88/// by values that contain line breaks.
89/// -z, --null
90pub fn null() -> FnOptionArg {
91 option_arg::simple(NULL)
92}
93
94/// Output only the names of config variables for --list or --get-regexp.
95/// --name-only
96pub fn name_only() -> FnOptionArg {
97 option_arg::simple(NAME_ONLY)
98}
99
100/// Augment the output of all queried config options with the origin type (file, standard input, blob, command line)
101/// and the actual origin (config file path, ref, or blob id if applicable).
102/// --show-origin
103pub fn show_origin() -> FnOptionArg {
104 option_arg::simple(SHOW_ORIGIN)
105}
106
107/// Opens an editor to modify the specified config file; either --system, --global, or repository (default).
108/// -e, --edit
109pub fn edit() -> FnOptionArg {
110 option_arg::simple(EDIT)
111}