Skip to content

Commit fa66a3f

Browse files
committed
made help messages more concise and to the point
1 parent 230fd10 commit fa66a3f

1 file changed

Lines changed: 40 additions & 90 deletions

File tree

src/main.rs

Lines changed: 40 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,17 @@ pub struct Context {
3535
/// Choose which dotfile profile to use.
3636
///
3737
/// A profile is a separate dotfiles repository (eg `dotfiles_work`),
38-
/// allowing you to (for example) keep work-related configuration in a
39-
/// separate repository to your personal configuration.
38+
/// allowing you to separate configuration files into many repos.
4039
#[arg(short, long)]
4140
pub profile: Option<String>,
4241

4342
/// No filesystem operations. Only print what would happen.
4443
#[arg(short = 'n', long)]
4544
pub dry_run: bool,
4645

47-
/// Select custom targets to use when deploying dotfiles.
46+
/// Enable custom targets when deploying dotfiles.
4847
///
49-
/// When a custom target is selected, config files, hooks and secrets from
50-
/// groups matching that target will be preferred over less-specific
51-
/// groups.
48+
/// Groups with custom targets have higher preference over every other group.
5249
#[arg(short = 't', long = "targets", use_value_delimiter = true)]
5350
pub custom_targets: Vec<String>,
5451
}
@@ -78,10 +75,10 @@ struct Cli {
7875

7976
#[derive(Subcommand)]
8077
enum Command {
81-
/// Get dotfiles' symlinking status (alias: s).
78+
/// Get dotfiles' symlinking status.
8279
///
8380
/// If groups are supplied, only the status of those groups will be shown.
84-
#[command(alias = "s")]
81+
#[command(visible_alias = "s")]
8582
Status {
8683
#[arg(value_name = "group")]
8784
groups: Option<Vec<String>>,
@@ -91,12 +88,12 @@ enum Command {
9188
json: bool,
9289
},
9390

94-
/// Deploy dotfiles for the supplied groups (alias: a).
91+
/// Deploy dotfiles for the supplied groups.
9592
///
9693
/// Each file within the dotfiles groups will be linked to its
9794
/// corresponding location on the system, effectively "installing" those
9895
/// groups' files.
99-
#[command(alias = "a")]
96+
#[command(visible_alias = "a")]
10097
Add {
10198
#[arg(required = true, value_name = "group")]
10299
groups: Vec<String>,
@@ -107,44 +104,26 @@ enum Command {
107104

108105
/// Override conflicting dotfiles.
109106
///
110-
/// If a file exists on the system and in the dotfiles repository, the
111-
/// version from the dotfiles repository will be used to overwrite the
112-
/// version on the system.
107+
/// Override dotfiles on the system with dotfiles in the repository.
113108
#[arg(short, long)]
114109
force: bool,
115110

116111
/// Adopt conflicting dotfiles.
117112
///
118-
/// If a file exists on the system and in the dotfiles repository, the
119-
/// version from the system will be used to overwrite the version
120-
/// in the dotfiles repository.
113+
/// Override repository dotfiles with dotfiles on the system.
121114
#[arg(short, long)]
122115
adopt: bool,
123116

124-
/// Automatically answer yes on every prompt.
117+
/// Answer yes to every prompt.
125118
#[arg(short = 'y', long)]
126119
assume_yes: bool,
127120

128-
/// Recursively create symbolic links to files, instead of to the first
129-
/// un-created directory.
130-
///
131-
/// This allows you to have different groups place files within the
132-
/// same location, even if that location does not already exist on the
133-
/// system.
134-
///
135-
/// For example, if group `a` contains `bin/foo` and group `b` contains
136-
/// `bin/bar`, and `~/bin` does not already exist on the system, then
137-
/// failure to specify this option would cause a conflict as both
138-
/// groups would try to create the `~/bin` directory as a symbolic
139-
/// link.
121+
/// Only symlink files and create their parent directories
140122
#[arg(long)]
141123
only_files: bool,
142124
},
143125

144-
/// Remove dotfiles for the supplied groups.
145-
///
146-
/// This removes the symbolic links on the system which point to files
147-
/// within the given groups.
126+
/// Remove dotfiles for specified groups.
148127
Rm {
149128
#[arg(required = true, value_name = "group")]
150129
groups: Vec<String>,
@@ -159,42 +138,27 @@ enum Command {
159138
#[arg(required = true, value_name = "group")]
160139
groups: Vec<String>,
161140

162-
/// Exclude certain groups from being added and hooked.
141+
/// Exclude certain groups from being added and their setup hooks ran.
163142
#[arg(short, long, value_name = "group", use_value_delimiter = true)]
164143
exclude: Vec<String>,
165144

166145
/// Override conflicting dotfiles.
167146
///
168-
/// If a file exists on the system and in the dotfiles repository, the
169-
/// version from the dotfiles repository will be used to overwrite the
170-
/// version on the system.
147+
/// Override dotfiles on the system with dotfiles in the repository.
171148
#[arg(short, long)]
172149
force: bool,
173150

174151
/// Adopt conflicting dotfiles.
175152
///
176-
/// If a file exists on the system and in the dotfiles repository, the
177-
/// version from the system will be used to overwrite the version
178-
/// in the dotfiles repository.
153+
/// Override repository dotfiles with dotfiles on the system.
179154
#[arg(short, long)]
180155
adopt: bool,
181156

182-
/// Automatically answer yes to stdin prompts.
157+
/// Answer yes to every prompt.
183158
#[arg(short = 'y', long)]
184159
assume_yes: bool,
185160

186-
/// Recursively create symbolic links to files, instead of to the first
187-
/// un-created directory.
188-
///
189-
/// This allows you to have different groups place files within the
190-
/// same location, even if that location does not already exist on the
191-
/// system.
192-
///
193-
/// For example, if group `a` contains `bin/foo` and group `b` contains
194-
/// `bin/bar`, and `~/bin` does not already exist on the system, then
195-
/// failure to specify this option would cause a conflict as both
196-
/// groups would try to create the `~/bin` directory as a symbolic
197-
/// link.
161+
/// Only symlink files and create parent directories
198162
#[arg(long)]
199163
only_files: bool,
200164
},
@@ -204,13 +168,13 @@ enum Command {
204168
#[arg(required = true, value_name = "group")]
205169
groups: Vec<String>,
206170

207-
/// Exclude certain groups from being removed
171+
/// Exclude certain groups from being removed and their cleanup hooks ran.
208172
#[arg(short, long, value_name = "group", use_value_delimiter = true)]
209173
exclude: Vec<String>,
210174
},
211175

212-
/// Encrypt files and move them to dotfiles/Secrets (alias: e)
213-
#[command(alias = "e")]
176+
/// Encrypt files and move them to dotfiles/Secrets
177+
#[command(visible_alias = "e")]
214178
Encrypt {
215179
#[arg(required = true)]
216180
group: String,
@@ -219,12 +183,13 @@ enum Command {
219183
dotfiles: Vec<String>,
220184
},
221185

222-
/// Decrypt files (alias: d)
223-
#[command(alias = "d")]
186+
/// Decrypt files
187+
#[command(visible_alias = "d")]
224188
Decrypt {
225189
#[arg(required = true, value_name = "group")]
226190
groups: Vec<String>,
227191

192+
/// Exclude certain groups from being decrypted
228193
#[arg(short, long, value_name = "group", use_value_delimiter = true)]
229194
exclude: Vec<String>,
230195
},
@@ -242,42 +207,27 @@ enum Command {
242207
#[arg(required = true)]
243208
files: Vec<String>,
244209

245-
/// Automatically answer yes on every prompt. In the case where a file
246-
/// already exists in the dotfiles, this will overwrite it.
210+
/// Answer yes to every prompt.
247211
#[arg(short = 'y', long)]
248212
assume_yes: bool,
249213

250214
/// Symlink files after pushing them into the dotfiles repository.
251-
/// This is the equivalent to running `tuckr add [group]` manually
252-
/// after this command.
253215
#[arg(short = 'a', long)]
254216
add: bool,
255217

256-
/// Recursively create symbolic links to files, instead of to the first
257-
/// un-created directory when adding dotfiles.
258-
///
259-
/// This option only takes effect when the `--add` flag is also used.
260-
///
261-
/// This allows you to have different groups place files within the
262-
/// same location, even if that location does not already exist on the
263-
/// system.
264-
///
265-
/// For example, if group `a` contains `bin/foo` and group `b` contains
266-
/// `bin/bar`, and `~/bin` does not already exist on the system, then
267-
/// failure to specify this option would cause a conflict as both
268-
/// groups would try to create the `~/bin` directory as a symbolic
269-
/// link.
218+
/// Only symlink files and create parent directories
270219
#[arg(long)]
271220
only_files: bool,
272221
},
273222

274-
/// Delete the given groups from the dotfiles, cleaning up any left-over
275-
/// symbolic links.
223+
/// Pop specified groups and their corresponding symlinks
224+
///
225+
/// Moves files back to the system and out of the repository.
276226
#[command(arg_required_else_help = true)]
277227
Pop {
278228
groups: Vec<String>,
279229

280-
/// Delete groups instead of popping them out dotfiles
230+
/// Delete groups' files instead of moving them back to the system
281231
#[arg(short, long)]
282232
delete: bool,
283233

@@ -286,34 +236,34 @@ enum Command {
286236
assume_yes: bool,
287237
},
288238

289-
/// List dotfiles hooks, secrets, profiles
239+
/// List dotfiles hooks, secrets and profiles
290240
#[command(subcommand, arg_required_else_help = true)]
291241
Ls(ListType),
292242

293-
/// Initialize dotfile directory
243+
/// Initialize dotfiles directory
294244
///
295-
/// Creates the files that are necessary to use Tuckr
245+
/// Creates necessary files to use Tuckr
296246
Init,
297247

298-
/// Return the group files belongs to
248+
/// Return the group files belong to
299249
#[command(name = "groupis", arg_required_else_help = true)]
300250
GroupIs { files: Vec<String> },
301251

302-
/// Convert a GNU Stow dotfiles repository into a Tuckr repository.
252+
/// Convert a GNU Stow dotfiles directory into a Tuckr directory.
303253
#[command(name = "from-stow", long_about = fileops::FROM_STOW_INFO)]
304254
FromStow { stow_path: Option<String> },
305255
}
306256

307257
#[derive(Debug, Subcommand)]
308258
enum ListType {
309-
/// Lists dotfiles directories with a suffix _<profile> (alias: p)
310-
#[command(alias = "p")]
259+
/// List dotfiles directories with a profiles (ie `dotfiles_<profile>`)
260+
#[command(visible_alias = "p")]
311261
Profiles,
312-
/// Lists encrypted files (alias: s)
313-
#[command(alias = "s")]
262+
/// List encrypted groups
263+
#[command(visible_alias = "s")]
314264
Secrets,
315-
/// Lists which hooks exists for each group (alias: h)
316-
#[command(alias = "h")]
265+
/// List which hooks exist for each group
266+
#[command(visible_alias = "h")]
317267
Hooks,
318268
}
319269

0 commit comments

Comments
 (0)