From 22cfbe7faa2e9d32e5c78b273d05cee806861c12 Mon Sep 17 00:00:00 2001 From: acooler15 Date: Thu, 11 Feb 2021 09:19:12 +0800 Subject: [PATCH] add function extra_command (#6357) --- package/base-files/files/etc/rc.common | 39 +++++++++++++++++--------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 7c1154440..f39b69464 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -62,20 +62,24 @@ depends() { return 0 } +ALL_HELP="" +ALL_COMMANDS="boot shutdown depends" +extra_command() { + local cmd="$1" + local help="$2" + + local extra="$(printf "%-16s%s" "${cmd}" "${help}")" + ALL_HELP="${ALL_HELP}\t${extra}\n" + ALL_COMMANDS="${ALL_COMMANDS} ${cmd}" +} + help() { cat <