pub fn print_dir_stack(&self, short: bool) {
        if self.dir_stack.is_empty() {
            return;
        }

        // Print in reverse order so that the head dir is first.
        let len = self.dir_stack.len();
        for (num, dir) in self.dir_stack.iter().rev().enumerate() {
            if short {
                if num == 0 {
                    if len == 1 {
                        println!("{}", dir);
                    } else {
                        print!("[{}] ", dir);
                    }
                } else if num < len - 1 {
                    print!("{} ", dir);
                } else {
                    println!("{}", dir);
                }

            // Long formats.
            } else if num == 0 {
                println!("{}>\t{}", num, dir);
            } else {
                println!("{} \t{}", num, dir);
            }
        }
    }
/// Prints directory stack to stdout.
///
/// `short` means all on one line, otherwise a list.
Prints directory stack to stdout.
`short` means all on one line, otherwise a list.
Prints directory stack to stdout . ` short ` means all on one line otherwise a list .
pub fn print_dir_stack(&self, short: bool) {
        if self.dir_stack.is_empty() {
            return;
        }
        // Print in reverse order so that the head dir is first.
        let len = self.dir_stack.len();
        for (num, dir) in self.dir_stack.iter().rev().enumerate() {
            if short {
                if num == 0 {
                    if len == 1 {
                        println!("{}", dir);
                    } else {
                        print!("[{}] ", dir);
                    }
                } else if num < len - 1 {
                    print!("{} ", dir);
                } else {
                    println!("{}", dir);
                }
            // Long formats.
            } else if num == 0 {
                println!("{}>\t{}", num, dir);
            } else {
                println!("{} \t{}", num, dir);
            }
        }
    }
pub fn print_dir_stack ( & self , short : bool ) { if self . dir_stack . is_empty ( ) { return ; } // Print in reverse order so that the head dir is first. let len = self . dir_stack . len ( ) ; for ( num , dir ) in self . dir_stack . iter ( ) . rev ( ) . enumerate ( ) { if short { if num == 0 { if len == 1 { println ! ( " " dir ) ; } else { print ! ( " " dir ) ; } } else if num < len - 1 { print ! ( " " dir ) ; } else { println ! ( " " dir ) ; } // Long formats. } else if num == 0 { println ! ( " \t " num dir ) ; } else { println ! ( " \t " num dir ) ; } } }
Prints directory stack to stdout.
Prints directory stack to stdout .
&self
short
bool