Skip to content

Commit

Permalink
Merge pull request #4590 from piotrkwiecinski/mv-move-string-to-md-file
Browse files Browse the repository at this point in the history
mv: move help strings to markdown file
  • Loading branch information
sylvestre authored Mar 23, 2023
2 parents 7853d37 + ac01925 commit 9090dd7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
9 changes: 9 additions & 0 deletions src/uu/mv/mv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# mv

```
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...
```

Move `SOURCE` to `DEST`, or multiple `SOURCE`(s) to `DIRECTORY`.
17 changes: 4 additions & 13 deletions src/uu/mv/src/mv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::path::{Path, PathBuf};
use uucore::backup_control::{self, BackupMode};
use uucore::display::Quotable;
use uucore::error::{FromIo, UError, UResult, USimpleError, UUsageError};
use uucore::{format_usage, prompt_yes, show};
use uucore::{format_usage, help_about, help_usage, prompt_yes, show};

use fs_extra::dir::{
get_size as dir_get_size, move_dir, move_dir_with_progress, CopyOptions as DirCopyOptions,
Expand Down Expand Up @@ -53,12 +53,8 @@ pub enum OverwriteMode {
Force,
}

static ABOUT: &str = "Move SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.";
static LONG_HELP: &str = "";
const USAGE: &str = "\
{} [OPTION]... [-T] SOURCE DEST
{} [OPTION]... SOURCE... DIRECTORY
{} [OPTION]... -t DIRECTORY SOURCE...";
const ABOUT: &str = help_about!("mv.md");
const USAGE: &str = help_usage!("mv.md");

static OPT_FORCE: &str = "force";
static OPT_INTERACTIVE: &str = "interactive";
Expand All @@ -73,12 +69,7 @@ static ARG_FILES: &str = "files";

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let help = format!(
"{}\n{}",
LONG_HELP,
backup_control::BACKUP_CONTROL_LONG_HELP
);
let mut app = uu_app().after_help(help);
let mut app = uu_app().after_help(backup_control::BACKUP_CONTROL_LONG_HELP);
let matches = app.try_get_matches_from_mut(args)?;

if !matches.contains_id(OPT_TARGET_DIRECTORY)
Expand Down

0 comments on commit 9090dd7

Please sign in to comment.