File: diff_options.sh

package info (click to toggle)
fuse-emulator 1.5.7%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,024 kB
  • sloc: ansic: 87,196; sh: 11,456; perl: 3,916; makefile: 991; yacc: 245; lex: 139
file content (38 lines) | stat: -rwxr-xr-x 1,052 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

# diff_options.sh: diff shell-completion and man options with settings.dat

echo BASH
echo ====

# --help and --version options are not stored as settings
sed -e '1,/if \[\[ "$cur" == -\* \]\]; then/d' < bash/fuse | \
  grep -o -E '\-\-[a-Za-z0-9\-]+' | sort |
  grep -v -e "\-\-help" -e "\-\-version" > bash.txt

awk < ../../settings.dat \
  'BEGIN{ FS = "," } \
   { \
     if( $1 ~ "^#" ) next; \
     if( $2 ~ "null" ) next; \
     if( $5 != "" ) option = $5; else option = $1; \
     gsub( /^[ \t]+/, "", option ); \
     if( option != "" ) { \
       print option;
       if( $2 ~ "boolean" ) print "no-" option; \
     }
   }' | \
  sed -e 's/_/\-/g' -e 's/^/\-\-/' | sort > settings.txt

diff -U 0 bash.txt settings.txt

echo
echo MAN
echo ===

grep -o -E '\\\-\\\-[a-Za-z0-9\\\-]+' ../../man/fuse.1 | \
  sed -e 's/\\\-/\-/g' -e 's/\-\-no\-/\-\-/g' | sort | uniq | \
  grep -v -e "\-\-disable\-ui\-joystick" -e "\-\-foo" -e "\-\-help" \
          -e "\-\-version" > man.txt

grep -v -e "\-\-no\-" settings.txt | diff -U 0 man.txt -