emad-elsaid / dirtree

Visualizing files paths as an interactive tree, works nicely with gnu linux tools such as find, ls, or git ls-files
MIT License
118 stars 11 forks source link

Usage Question #12

Closed DadTheTester closed 1 month ago

DadTheTester commented 1 month ago

I tried the command dirtree -o output.html */ * as you listed it. Worked fine.

However, I was hoping for just a subdirectory and its tree. I tried dirtree -o output.html /tor-browser/*/ * and other permutations of that. It always seems to get all the way to the root of the user directory, but misses the lower levels.

I think I've forgotten my command line usage when it comes to this sort of thing.

Could you please point me in the right direction?

Thanks.

emad-elsaid commented 1 month ago

Should be something like : dirtree -o output.html subdir/*/

On Mon, Jul 8, 2024, 2:06 AM DadTheTester @.***> wrote:

I tried the command dirtree -o output.html */ * as you listed it. Worked fine.

However, I was hoping for just a subdirectory and its tree. I tried dirtree -o output.html /tor-browser/*/ * and other permutations of that. It always seems to get all the way to the root of the user directory, but misses the lower levels.

I think I've forgotten my command line usage when it comes to this sort of thing.

Could you please point me in the right direction?

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/emad-elsaid/dirtree/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANJA44RKFV7NYRZG7GY3DZLHJZNAVCNFSM6AAAAABKPY7NAWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4TIMRZGE2TSOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DadTheTester commented 1 month ago

Is subdir an actual command?

DadTheTester commented 1 month ago

/usr/local/bin/dirtree

To get autocompletion functionality

run: dirtree completion >> ~/.bashrc

Or, dirtree completion > /usr/local/etc/bash_completion.d/dirtree

!/usr/bin/env bash

_dirtree_completions() { local cur prev

cur=${COMP_WORDS[COMP_CWORD]}
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=() 
if [ "${#COMP_WORDS[@]}" != "2" ]; then
    return
fi
case "$cur" in
    -*)
    COMPREPLY=( $( compgen -W '-v -h -l -s -o -t \
                           --version --help --local \
                           --screenshot --output --template' -- $cur ) )                           
    ;;
esac

if [[ ${prev} == -t ]] || [[ ${prev} == --template ]]; then
    COMPREPLY=( $( compgen -W 'circles flame tree treemap' -- $cur ) )
fi

return 0

}

complete -F _dirtree_completions dirtree

emad-elsaid commented 1 month ago

sounds about right, ok when you say it doesn't work what do you exactly mean?

emad-elsaid commented 1 month ago

ok we started to mix both issues. I'll close this one