summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnastasios Grammenos <anastasios.grammenos@noris.gr>2021-08-20 15:53:02 +0300
committerAnastasios Grammenos <anastasios.grammenos@noris.gr>2021-08-20 15:53:02 +0300
commite07e3afab2b001d787025a4237c15b15c41b5b9d (patch)
treeda2b463e83f1dfd3eaaa3847625f5a43ad0f3aa9
parentc642675ba86d841d881215e8e5e28013103bd0ff (diff)
downloadconf-e07e3afab2b001d787025a4237c15b15c41b5b9d.tar.gz
conf-e07e3afab2b001d787025a4237c15b15c41b5b9d.tar.bz2
conf-e07e3afab2b001d787025a4237c15b15c41b5b9d.zip
Add cat commandHEADmaster
-rwxr-xr-xconf9
-rw-r--r--conf_completion4
2 files changed, 11 insertions, 2 deletions
diff --git a/conf b/conf
index c7b8454..b299e2d 100755
--- a/conf
+++ b/conf
@@ -201,6 +201,11 @@ function edit {
return 1
}
+function conf_cat {
+ TMP=$(TERM=dumb edit "$@")
+ cat "${TMP}"
+}
+
function relink {
CONF_GROUPS=($(list -G))
SELECTED_GROUPS=()
@@ -277,6 +282,10 @@ case ${1} in
shift
search "$@"
;;
+ cat | c) ## cat managed files
+ shift
+ conf_cat "$@"
+ ;;
edit | e) ## edit managed files
shift
edit "$@"
diff --git a/conf_completion b/conf_completion
index a8d5d3b..6c27456 100644
--- a/conf_completion
+++ b/conf_completion
@@ -4,7 +4,7 @@ _conf()
{
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
- local commands="add ls list search edit relink grep help version"
+ local commands="add ls list search edit cat relink grep help version"
if [[ $COMP_CWORD -gt 1 ]]; then
local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"
case "${COMP_WORDS[1]}" in
@@ -22,7 +22,7 @@ _conf()
COMPREPLY=($(compgen -f -- ${cur}))
fi
;;
- edit|e|editg|eg)
+ edit|e|editg|eg|cat|c)
COMPREPLY=($(compgen -W "$(conf ls -G) \
$(conf ls -l | xargs -If basename f) \
$(for g in $(conf ls -G); do \