1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! The Patina CLI is a simple command line application written in rust for processing
//! Patina template files and applying them to locations on the file system.
//!
//! `dotpatina` takes templated configuration files (using handlebars templating), rendering configuration files, and applying them to target locations on the file system. This information is provided by a Patina toml file.
//!
//! ### Patina File
//!
//! This is an example Patina file for git tooling.
//!
//! ```toml
//! # Metadata fields describe the Patina
//! name = "git-patina"
//! description = "A Patina for git tooling"
//!
//! # Variables are free-form and can be defined for the whole Patina.
//! # Or, variables can be loaded from separate files from the command line.
//! [vars]
//! editor = "vim"
//!
//! # A list of files define a template and target file.
//! # The template is a handlebar template (or plain file) that is processed.
//! # The target is the system location to store the rendered template.
//! [[files]]
//! template = "gitconfig.hbs"
//! target = "../../output/.gitconfig"
//!
//! [[files]]
//! template = "lazygit.config.yml"
//! target = "../../output/lazygit.config"
//! ```
//!
//! ### Variables Files
//!
//! Variables can be stored in separate toml files. Variables are free-form and overlay on top of the base Patina variables.
//!
//! This is useful when variables need to change based on the machine Patinas are being applied to.
//!
//! ```toml
//! [user]
//! name = "User Name"
//! email = "user@email.com"
//! ```
//!
//! ### Template Files
//!
//! Patina templates are defined using handlebars templates. Or, they can be raw files if no templating is required.
//!
//! #### Handlebar Template
//!
//! Templates are rendered using the variables provided directly in the Patina file and passed as separate variables files. In this example, `editor` is provided in the Patina file but `user.email` and `user.name` are provided in a separate variables file.
//!
//! `gitconfig.hbs`
//!
//! ```hbs
//! [user]
//! email = <{{ user.email }}>
//! name = <{{ user.name }}>
//! [pager]
//! branch = false
//! [core]
//! editor = {{ editor }}
//! [pull]
//! rebase = false
//! [init]
//! defaultBranch = main
//! [fetch]
//! prune = true
//! ```
//!
//! #### Raw File
//!
//! Raw files without templating work as well.
//!
//! `lazygit.config.yml`
//!
//! ```yml
//! gui:
//! showBottomLine: false
//! showCommandLog: false
//! showPanelJumps: false
//! border: rounded
//! showNumstatInFilesView: true
//!
//! customCommands:
//! - key: "U"
//! command: "git submodule update --init --recursive"
//! context: "files, localBranches, status"
//! description: "Update submodules"
//! stream: true
//! ```
use PatinaCli;
/// Main entry point for the application.
/// This launches the CLI interface.