deno.land / x / sheetjs@v0.18.3 / misc / help.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash# make_help.sh -- process listing of targets and special items in Makefile# Copyright (C) 2016-present SheetJS## usage in makefile: pipe the output of the following command:# @grep -hE '(^[a-zA-Z_-][ a-zA-Z_-]*:.*?|^#[#*])' $(MAKEFILE_LIST)## lines starting with "## " are treated as subtitles# lines starting with "#* " are treated as plaintext comments# multiple targets with "## " after the ":" are rendered as separate targets# if the presumed default target is labeled, it will be assigned a unique color
awk 'BEGIN{recipes=0;} !/#[#*] .*$/ {next;} {multi=0; isrecipe=0;} /^[^#]*:/ {isrecipe=1; ++recipes;} /^[^ :]* .*:/ {multi=1} multi==0 && isrecipe>0 { if(recipes > 1) print; else print $0, "[default]"; next} isrecipe == 0 {print; next} multi>0 { k=split($0, msg, "##"); m=split($0, a, ":"); n=split(a[1], b, " "); for(i=1; i<=n; ++i) print b[i] ":", "##" msg[2], (recipes==1 && i==1 ? "[default]" : "") }END {}' | if [[ -t 1 ]]; thenawk 'BEGIN {FS = ":.*?## "} {color=36} /\[default\]/ {color=35} NF==1 && /^##/ {color=34} NF==1 && /^#\*/ {color=20; $1 = substr($1, 4)} {printf "\033[" color "m%-20s\033[0m %s\n", $1, $2;}END{}' -elseawk 'BEGIN {FS = ":.*?## "} /^#\* / {$1 = substr($1, 4)} {printf "%-20s %s\n", $1, $2;}END{}' -fi

sheetjs
📗 SheetJS Community Edition -- Spreadsheet Data Toolkit
GitHub RepositorySheetJS/sheetjs
GitHub Stars
32133

Version Info

Tagged at
11 months ago