Repository: nushell/nushell
File: crates/nu-command/src/filesystem/du.rs (Rust)

Code before:
                Some('r'),
            )
            .switch(
                "long",
                "Get underlying directories and files for each entry",
                Some('l'),
            )
            .named(
                "exclude",
                SyntaxShape::GlobPattern,
                "Exclude these file names",
                Some('x'),
            )
            .named(
                "max-depth",
                SyntaxShape::Int,
                "Directory recursion limit",
                Some('d'),
            )
            .named(
                "min-size",
                SyntaxShape::Int,
                "Exclude files below this size",
                Some('m'),
            )
            .switch("all", "Move hidden files if '*' is provided.", Some('a'))
            .category(Category::FileSystem)
    }

    fn run(
        &self,
        engine_state: &EngineState,
        stack: &mut Stack,
        call: &Call,
        _input: PipelineData,
    ) -> Result<PipelineData, ShellError> {
        let tag = call.head;
        let min_size: Option<Spanned<i64>> = call.get_flag(engine_state, stack, "min-size")?;
        let max_depth: Option<Spanned<i64>> = call.get_flag(engine_state, stack, "max-depth")?;
        if let Some(ref max_depth) = max_depth
            && max_depth.item < 0
        {
            return Err(ShellError::NeedsPositiveValue {
                span: max_depth.span,
            });
        }
        if let Some(ref min_size) = min_size
            && min_size.item < 0
        {
            return Err(ShellError::NeedsPositiveValue {
                span: min_size.span,

Review comment (suggestion):
du doesn't move files
```suggestion
            .switch("all", "Include hidden files if '*' is provided.", Some('a'))
```

Code after:
                Some('r'),
            )
            .switch(
                "long",
                "Get underlying directories and files for each entry",
                Some('l'),
            )
            .named(
                "exclude",
                SyntaxShape::GlobPattern,
                "Exclude these file names",
                Some('x'),
            )
            .named(
                "max-depth",
                SyntaxShape::Int,
                "Directory recursion limit",
                Some('d'),
            )
            .named(
                "min-size",
                SyntaxShape::Int,
                "Exclude files below this size",
                Some('m'),
            )
            .switch("all", "Include hidden files if '*' is provided.", Some('a'))
            .category(Category::FileSystem)
    }

    fn run(
        &self,
        engine_state: &EngineState,
        stack: &mut Stack,
        call: &Call,
        _input: PipelineData,
    ) -> Result<PipelineData, ShellError> {
        let tag = call.head;
        let min_size: Option<Spanned<i64>> = call.get_flag(engine_state, stack, "min-size")?;
        let max_depth: Option<Spanned<i64>> = call.get_flag(engine_state, stack, "max-depth")?;
        if let Some(ref max_depth) = max_depth
            && max_depth.item < 0
        {
            return Err(ShellError::NeedsPositiveValue {
                span: max_depth.span,
            });
        }
        if let Some(ref min_size) = min_size
            && min_size.item < 0
        {
            return Err(ShellError::NeedsPositiveValue {
                span: min_size.span,