update comment style

pull/3/head
kevin zhuang 4 years ago
parent 21da409977
commit c785d98e23

@ -7,18 +7,21 @@
# ${mydir}: string, directory of the executing script, used for sourcing helpers
# ${action_command}: string, determine which script to call
# Arguments
# command: command to run general git command/fadd/frm/fpop etc
# $opt: options flag -h -p etc
# action_command: sub commands dotbare should run
# General git command: log, status etc
# dotbare specific commands: fadd | frm | fpop | freset | fcheckout | help
# option flags:
# check sub commands for available option flags
mydir="${0%/*}"
source "${mydir}"/helper/set_variable
source "${mydir}"/helper/set_variable.sh
function usage() {
echo "help"
}
# if no argument passed in, let git display help message
if [[ -z "$@" ]]; then
if [[ $# -eq 0 ]]; then
/usr/bin/git --git-dir="${DOTBARE_DIR}" --work-tree="${DOTBARE_TREE}"
exit 0
fi

@ -1,25 +1,14 @@
#!/bin/bash
#
# search local file or directory taking consideration of optional dependency
#
# @params
# Globals
# search_type: string, f or d, search file or directory
# exe_fd: number, 0 or 1, check if fd is executable
# exe_tree: number, 0 or 1, check if tree is executable
# Arguments
# search_type: string, f or d, search file or directory
function fd_exists() {
fd -V &>/dev/null
echo "$?"
}
function tree_exists() {
tree --version &>/dev/null
echo "$?"
}
#######################################
# search local file
# Arguments:
# $1: stirng, f or d, search file or directory
# Outputs:
# A user selected file path
#######################################
function search_file() {
local search_type="$1"
local exe_fd="$(fd_exists)"
@ -42,3 +31,13 @@ function search_file() {
fi
fi
}
function fd_exists() {
fd -V &>/dev/null
echo "$?"
}
function tree_exists() {
tree --version &>/dev/null
echo "$?"
}

@ -4,11 +4,11 @@
#
# @params
# Globals
# DOTBARE_DIR: string, location of the bare repo
# DOTBARE_TREE: string, which folder is the bare repo tracking
# DOTBARE_KEY: string, defualt key bindings
# FZF_DEFAULT_OPTS: string, update FZF_DEFAULT_OPTS to reflect dotbare changes
# DOTBARE_FZF_DEFAULT_OPTS: string, user custom setting for dotbare
# ${DOTBARE_DIR}: string, location of the bare repo
# ${DOTBARE_TREE}: string, which folder is the bare repo tracking
# ${DOTBARE_KEY}: string, defualt key bindings
# ${FZF_DEFAULT_OPTS}: string, update FZF_DEFAULT_OPTS to reflect dotbare changes
# ${DOTBARE_FZF_DEFAULT_OPTS}: string, user custom setting for dotbare
[[ -z "${DOTBARE_DIR}" ]] && DOTBARE_DIR="$HOME/.cfg/"
[[ -z "${DOTBARE_TREE}" ]] && DOTBARE_TREE="$HOME"

@ -12,8 +12,8 @@
set -e
mydir="${0%/*}"
source "${mydir}"/../helper/search_file
source "${mydir}"/../helper/set_variable
source "${mydir}"/../helper/search_file.sh
source "${mydir}"/../helper/set_variable.sh
function usage() {
echo -e "Usage: dotbare fadd [-h] [-f] [-d] ...\n"

@ -1,13 +1,14 @@
#!/bin/bash
#
# checkout files/commits using fzf
# checkout files/commits/branches using fzf
#
# @params
# Globals
# all_files: search all tracked files instead of just the modified files
# branch: checkout branch
# selected_branch: selected_branch to switch
# selected_files: selected_files to checkout to the version in HEAD
# ${mydir}: current directory of the script, used for imports
# ${all_files}: search all tracked files instead of just the modified files
# ${branch}: checkout branch
# ${selected_branch}: selected_branch to switch
# ${selected_files}: selected_files to checkout to the version in HEAD
# Arguments
# -a: search all files instead of just the modified files
# -b: search branch and checkout branch
@ -16,8 +17,8 @@
set -e
mydir="${0%/*}"
source "${mydir}"/../helper/set_variable
source "${mydir}"/../helper/get_confirmation
source "${mydir}"/../helper/set_variable.sh
source "${mydir}"/../helper/get_confirmation.sh
function usage() {
echo -e "Usage: dotbare fcheckout [-h] [-c] [-S] [-H] ...\n"

@ -13,8 +13,8 @@
set -e
mydir="${0%/*}"
source "${mydir}"/../helper/set_variable
source "${mydir}"/../helper/get_confirmation
source "${mydir}"/../helper/set_variable.sh
source "${mydir}"/../helper/get_confirmation.sh
function usage() {
echo -e "Usage: dotbare freset [-h] [-c] [-S] [-H] ...\n"

Loading…
Cancel
Save