felixschndr / dotfiles

These are my personal bash aliases and functions I use on a daily basis
1 stars 0 forks source link

Diff: File als Argument übergeben und dann nur darauf den Diff machen #22

Closed felixschndr closed 3 years ago

felixschndr commented 3 years ago

Praktisch, wenn man nur ein File bearbeitet hat, aber noch andere Files uncommitted sind

felixschndr commented 3 years ago

Bash Completion mit complete -W "diff pull $("ls")" diff

felixschndr commented 3 years ago

oder so ähnlich, files in Ordner werden nicht vorgeschlagen, Ordner werden als files vorgeschlagen. find . -type f wäre wahrscheinlich zu viel, da es auch git files anzeigt

felixschndr commented 3 years ago

Autocompletion mit

complete -F _longopt -W "diff pull" diff

gelöst

┌─[21:13:27]-[:)]-[openhabian@openhab]-[/home/openhabian/bashrc/ (master)]
└──> diff <TAB> <TAB>
default/    diff        fixer       frank/      .git/       .gitignore  openhab/    pull        README.md   sourcer     updater