From 33f381d3d09f35abd4228a92d9c077c594827c4d Mon Sep 17 00:00:00 2001 From: kevin zhuang Date: Mon, 11 May 2020 08:52:06 +1000 Subject: [PATCH] fix formating --- helper/git_query.sh | 22 +++++++++++----------- scripts/fadd | 6 +++--- scripts/fedit | 6 +++--- scripts/freset | 10 +++++----- scripts/fstat | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/helper/git_query.sh b/helper/git_query.sh index 4f96f4f..cad9ff4 100644 --- a/helper/git_query.sh +++ b/helper/git_query.sh @@ -16,20 +16,20 @@ function get_commit() { local files="$2" if [[ -z "${files}" ]]; then /usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \ - log --oneline --color=always --decorate=short \ + log --oneline --color=always --decorate=short \ | fzf --no-multi --header="${header}" \ - --preview "echo {} \ + --preview "echo {} \ | awk '{print \$1}' \ | xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \ - show --color=always __" \ + show --color=always __" \ | awk '{print $1}' else /usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \ - log --oneline --color=always --decorate=short \ + log --oneline --color=always --decorate=short \ | fzf --no-multi --header="${header}" --preview "echo {} \ | awk '{print \$1}' \ | xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \ - diff --color=always __ $files" \ + diff --color=always __ $files" \ | awk '{print $1}' fi } @@ -87,9 +87,9 @@ function get_git_file() { local print_opt="${2:-full}" set_fzf_multi "$3" /usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \ - ls-files --full-name --directory "${DOTBARE_TREE}" \ + ls-files --full-name --directory "${DOTBARE_TREE}" \ | fzf --header="${header}" \ - --preview "head -50 ${DOTBARE_TREE}/{}" \ + --preview "head -50 ${DOTBARE_TREE}/{}" \ | awk -v home="${DOTBARE_TREE}" -v print_opt="${print_opt}" '{ if (print_opt == "full") { print home "/" $0 @@ -123,7 +123,7 @@ function get_modified_file() { local output_format="${3:-name}" set_fzf_multi "$4" /usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \ - status --porcelain \ + status --porcelain \ | awk -v display_mode="${display_mode}" '{ if ($0 ~ /^[A-Za-z][A-Za-z].*$/) { print "\033[32m" substr($0, 1, 1) "\033[31m" substr($0, 2) "\033[0m" @@ -140,7 +140,7 @@ function get_modified_file() { | fzf --header="${header}" --preview "echo {} \ | awk '{print \$2}' \ | xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \ - diff HEAD --color=always ${DOTBARE_TREE}/__" \ + diff HEAD --color=always ${DOTBARE_TREE}/__" \ | awk -v home="${DOTBARE_TREE}" -v format="${output_format}" '{ if (format == "name") { print home "/" $2 @@ -163,14 +163,14 @@ function get_stash() { local header="${1:-select a stash}" set_fzf_multi "$2" /usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}" \ - stash list \ + stash list \ | fzf --header="${header}" --preview "echo {} \ | awk '{ gsub(/:/, \"\", \$1) print \$1 }' \ | xargs -I __ /usr/bin/git --git-dir=${DOTBARE_DIR} --work-tree=${DOTBARE_TREE} \ - show -p __ --color=always" \ + show -p __ --color=always" \ | awk '{ gsub(/:/, "", $1) print $1 diff --git a/scripts/fadd b/scripts/fadd index 72a54d3..713e8fa 100755 --- a/scripts/fadd +++ b/scripts/fadd @@ -26,9 +26,9 @@ function usage() { echo -e "Stage the selected file to the dotfile gitbare repo" echo -e "Press escape to stop staging file\n" echo -e "optional arguments:" - echo -e " -h\t\tshow this help message and exit" - echo -e " -f\t\tselect a file in current directory and stage it" - echo -e " -d\t\tselect a entire folder to stage" + echo -e " -h\tshow this help message and exit" + echo -e " -f\tselect a file in current directory and stage it" + echo -e " -d\tselect a entire folder to stage" } ####################################### diff --git a/scripts/fedit b/scripts/fedit index e397b0b..3bf8c64 100755 --- a/scripts/fedit +++ b/scripts/fedit @@ -26,9 +26,9 @@ function usage() { echo -e "List all tracked dotfiles and edit" echo -e "also support commit message edit\n" echo -e "optional arguments:" - echo -e " -h\t\tshow this help message and exit" - echo -e " -m\t\tonly display modified file" - echo -e " -c\t\tedit commit using interactive rebase instead" + echo -e " -h\tshow this help message and exit" + echo -e " -m\tonly display modified file" + echo -e " -c\tedit commit using interactive rebase instead" } modified='' diff --git a/scripts/freset b/scripts/freset index f824a91..ad2b343 100755 --- a/scripts/freset +++ b/scripts/freset @@ -32,11 +32,11 @@ function usage() { echo -e "Reset/Unstage the selected staged file" echo -e "Or reset the HEAD to certain commits by using -c flag\n" echo -e "optional arguments:" - echo -e " -h\t\tshow this help message and exit" - echo -e " -a\t\tselect files and then select a commit to reset the file back to the selected comit" - echo -e " -c\t\treset commit to certain commit, default --mixed flag, reset HEAD to certain commit put all changes into modified states" - echo -e " -S\t\treset commit using --soft flag, reset HEAD to certain commit without modify working tree" - echo -e " -H\t\treset commit using --hard flag, reset HEAD to certain commit dicard all changes from the working tree" + echo -e " -h\tshow this help message and exit" + echo -e " -a\tselect files and then select a commit to reset the file back to the selected comit" + echo -e " -c\treset commit to certain commit, default --mixed flag, reset HEAD to certain commit put all changes into modified states" + echo -e " -S\treset commit using --soft flag, reset HEAD to certain commit without modify working tree" + echo -e " -H\treset commit using --hard flag, reset HEAD to certain commit dicard all changes from the working tree" } reset_commit="" diff --git a/scripts/fstat b/scripts/fstat index 5b6c8db..96200df 100755 --- a/scripts/fstat +++ b/scripts/fstat @@ -23,7 +23,7 @@ function usage() { echo -e "Display interactive git status menu" echo -e "Stage, unstage, interactively\n" echo -e "optional arguments:" - echo -e " -h\t\tshow this help message and exit" + echo -e " -h\tshow this help message and exit" } while getopts ":h" opt; do