From b6b03e4903cc95309ccb01091fb2196036841c5d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 20 Nov 2023 22:23:35 +0100 Subject: [PATCH] package/klish: simplify, maintain local version of klish.conf Also, add -S option to less, which causes lines longer than the screen width to be chopped (truncated) rather than wrapped. With available terminals supporting xterm a user can scroll right on really long lines. Signed-off-by: Joachim Wiberg --- package/klish/klish.conf | 21 +++++++++++++++++++++ package/klish/klish.mk | 5 +---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 package/klish/klish.conf diff --git a/package/klish/klish.conf b/package/klish/klish.conf new file mode 100644 index 00000000..bdb17162 --- /dev/null +++ b/package/klish/klish.conf @@ -0,0 +1,21 @@ +# Template for config file /etc/klish/klish.conf. It's used by klish utility. + +# The klishd uses UNIX domain socket to receive connections. It will create an +# filesystem entry to allow clients to find connection point. By default klish +# client utility will connect to /tmp/klish-unix-socket. +#UnixSocketPath=/tmp/klish-unix-socket + +# The klish can use external pager for non-interactive commands. By default it +# will execute "/usr/bin/less -I -F -e -X -K -d -r -S" process as a pager. +Pager="/usr/bin/less -I -F -e -X -K -d -r -S" + +# External pager is enabled by default. But user can explicitly enable or +# disable it. Use "y" or "n" values. +#UsePager=y + +# Set max size of history. By default 100 lines are saved, for every new +# line after that, the oldest line is dropped. Set to 0 for unlimited. +#HistorySize=100 + +# Save history after each (unique/non-repeated) command. +HistorySaveAlways=n diff --git a/package/klish/klish.mk b/package/klish/klish.mk index c7bc61db..f3fd4051 100644 --- a/package/klish/klish.mk +++ b/package/klish/klish.mk @@ -21,10 +21,7 @@ define KLISH_INSTALL_CONFIG $(INSTALL) -t $(TARGET_DIR)/etc/klish -D -m 0644 \ $(@D)/plugins/klish/xml/ptypes.xml $(INSTALL) -t $(TARGET_DIR)/etc/klish -D -m 0644 \ - $(@D)/klish.conf $(@D)/klishd.conf - sed -i 's/#HistorySaveAlways=n/HistorySaveAlways=y/' $(TARGET_DIR)/etc/klish/klish.conf - # Fix line drawing characters 'show interfaces' - sed -i 's/\(Pager.*\)-R\(.*\)/\1-r\2/' $(TARGET_DIR)/etc/klish/klish.conf + $(KLISH_PKGDIR)/klish.conf $(@D)/klishd.conf endef KLISH_POST_INSTALL_TARGET_HOOKS += KLISH_INSTALL_CONFIG