docs(fgrep): update help and code doc for fgrep

pull/21/head
Kevin Zhuang 4 years ago
parent 77657d3eb8
commit efbd93eb1e

@ -195,7 +195,8 @@ function get_stash() {
# all tracked files in the bare repo.
# Arguments:
# $1: the help message to display in header
# $2: if exists, don't do multi select, only allow single selection
# $2: the fzf delimiter to start searching, default is 3
# $3: if exists, don't do multi select, only allow single selection
# Outputs:
# the selected file name with it's line number and line, seperated by ":"
# e.g. .bash_profile:1:echo hello

@ -6,8 +6,11 @@
# Globals
# mydir: path to this current script
# selected_lines: selected lines to edit
# fzf_search_delimiter: the col to start searching in fzf
# Arguments
# -h|--help: show help message and exit
# -c COL| --col COL: use a different delimiter in fzf search
# -f|--full: include file name in fzf searching, as if using --col 1
set -e
set -f
@ -21,8 +24,12 @@ function usage() {
Grep words within tracked files and select to edit matches.
Default: start searching from 3rd column (excluding the file name during search).
Optional arguments:
-h, --help\t\tshow this help message and exit."
-h, --help\t\tshow this help message and exit.
-c COL, --col COL\tspecify the column number to start searching.
-f, --full\t\tinclude all column during search, as if using '--col 1'."
}
selected_lines=()
@ -30,7 +37,7 @@ fzf_search_delimiter=3
while [[ "$#" -gt 0 ]]; do
case "$1" in
-d|--delimiter)
-c|--col)
fzf_search_delimiter="$2"
shift
shift

Loading…
Cancel
Save