Skip to content

Commit

Permalink
Re-applied changes to support host in database.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopaganini committed Aug 26, 2024
1 parent d5a8c06 commit 20557b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions snip
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ readonly CONFIG_FILE="${CONFIG_DIR}/config.${SHORT_HOSTNAME?}"
readonly COLUMN_BASE_CMD=(
"column"
"--table"
"--table-columns-limit=3"
"--table-columns-limit=4"
"--separator=|"
"--output-separator=|"
"--table-column=name=HOST"
"--table-column=name=TIMESTAMP"
"--table-column=name=DESCRIPTION")

Expand Down Expand Up @@ -364,7 +365,7 @@ function find() {
if [[ -n "${query}" ]]; then
fzfcmd+=("-q" "${query}")
fi
cat <"${DB_FILE}" | "${COLUMN_FIND_CMD[@]}" | "${fzfcmd[@]}" | cut -d'|' -f3-
cat <"${DB_FILE}" | "${COLUMN_FIND_CMD[@]}" | "${fzfcmd[@]}" | cut -d'|' -f4-
}

# snip_bind_add - Bindings to add the current command-line to the database.
Expand Down Expand Up @@ -472,7 +473,7 @@ function get_fzf_cmd() {
"--ansi"
"--header-lines=1"
"--preview"
"cut -d'|' -f3- <<< {} | ${formatter_ref[*]}"
"cut -d'|' -f4- <<< {} | ${formatter_ref[*]}"
)
}

Expand Down

0 comments on commit 20557b5

Please sign in to comment.