diff options
author | Andrew Cady <d@jerkface.net> | 2023-08-23 18:24:31 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2023-08-23 18:24:31 -0400 |
commit | 88a9b8f49123a0679267231d5738e34d93cf86c4 (patch) | |
tree | 2f2f3692497fb3315daefbc0e2e4c0f8584a36dd | |
parent | a885b23dc3aab3077b43ea2453a1521d18ea7b05 (diff) |
beautify
-rw-r--r-- | rpc.bash | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -7,8 +7,7 @@ max_script_size=$((1024 * 64)) | |||
7 | our_main() | 7 | our_main() |
8 | { | 8 | { |
9 | REMOTE_DEST=localhost | 9 | REMOTE_DEST=localhost |
10 | unused=$(main2 "$@" </dev/null | xargs) | 10 | main2 "$@" |
11 | [ ! "$unused" ] || printf 'Local only: %s\n' "$unused" >&2 | ||
12 | main1 "$@" | 11 | main1 "$@" |
13 | } | 12 | } |
14 | 13 | ||
@@ -19,6 +18,12 @@ main1() | |||
19 | 18 | ||
20 | main2() | 19 | main2() |
21 | { | 20 | { |
21 | funcs=$(find_local_only_functions "$@" </dev/null | xargs) | ||
22 | [ ! "$funcs" ] || printf 'Local-only functions (main2): %s\n' "$funcs" >&2 | ||
23 | } | ||
24 | |||
25 | find_local_only_functions() | ||
26 | { | ||
22 | intersection <(extract_words < "$BASH_SOURCE") \ | 27 | intersection <(extract_words < "$BASH_SOURCE") \ |
23 | <(difference <(all_commands) \ | 28 | <(difference <(all_commands) \ |
24 | <(remote_run_function all_commands)) | 29 | <(remote_run_function all_commands)) |
@@ -42,6 +47,9 @@ fudge() | |||
42 | exit | 47 | exit |
43 | } | 48 | } |
44 | 49 | ||
50 | |||
51 | |||
52 | |||
45 | read_remote_command() | 53 | read_remote_command() |
46 | { | 54 | { |
47 | len=$1 | 55 | len=$1 |