diff options
Diffstat (limited to 'dotup_cli/src/commands/link.rs')
| -rw-r--r-- | dotup_cli/src/commands/link.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dotup_cli/src/commands/link.rs b/dotup_cli/src/commands/link.rs index 614c0ca..81c396b 100644 --- a/dotup_cli/src/commands/link.rs +++ b/dotup_cli/src/commands/link.rs | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | use clap::Clap; | ||
| 2 | use std::{ | 1 | use std::{ |
| 3 | fs::{DirEntry, Metadata}, | 2 | fs::{DirEntry, Metadata}, |
| 4 | path::{Path, PathBuf}, | 3 | path::{Path, PathBuf}, |
| @@ -6,11 +5,20 @@ use std::{ | |||
| 6 | 5 | ||
| 7 | use super::prelude::*; | 6 | use super::prelude::*; |
| 8 | 7 | ||
| 8 | /// Creates links | ||
| 9 | /// | ||
| 10 | /// If a link is created for a file that already had a link then the old link will be overwritten. | ||
| 11 | /// By default creating a link to a directory will recursively link all files under that | ||
| 12 | /// directory, to actually link a directory use the --directory flag. | ||
| 9 | #[derive(Clap)] | 13 | #[derive(Clap)] |
| 14 | #[clap(setting = AppSettings::ColoredHelp)] | ||
| 10 | pub struct Opts { | 15 | pub struct Opts { |
| 16 | /// Treats the paths as directories. This will create links to the actual directories instead | ||
| 17 | /// of recursively linking all files under them. | ||
| 11 | #[clap(long)] | 18 | #[clap(long)] |
| 12 | directory: bool, | 19 | directory: bool, |
| 13 | 20 | ||
| 21 | /// The paths to link. The last path is the destination. | ||
| 14 | paths: Vec<PathBuf>, | 22 | paths: Vec<PathBuf>, |
| 15 | } | 23 | } |
| 16 | 24 | ||
