Fossil SCM

Tweaks to makeinfo script.

brickviking 2025-03-28 23:27 bv-infotool
Commit 7bd0ad7a81d60aa8152342045753058558d5cc0d125fc567deb6c63068f5ccb7
1 file changed +3 -13
--- tools/fossil-makeinfo
+++ tools/fossil-makeinfo
@@ -171,22 +171,22 @@
171171
printf "@menu\n" >> fossil.texi
172172
173173
# Slurp in Common keywords from fossil help
174174
# WARNING: tail count is brittle
175175
echo "Grab common keywords for menu"
176
-for u in $(for t in $(fossil help | tail -n +4| sed '$d'); do echo "$t"; done | sort); do echo "* ${u}::"; done >> fossil.texi
176
+for u in $(for t in $(fossil help | tail -n +11| sed '$d'); do echo "$t"; done | sort); do echo "* ${u}::"; done >> fossil.texi
177177
178178
# Add end menu, add some space too
179179
printf "@end menu
180180
181181
" >> fossil.texi
182182
183183
# Add in the actual help for common commands
184184
# WARNING: tail count is brittle
185
-# tail command pops off the first six lines, sed commands remove the last two lines.
185
+# tail command pops off the first fourteen lines, sed commands remove the last two lines.
186186
echo "Fossil output common help to workfile"
187
-fossil help -v | tail -n +7 | sed '$d' | sed '$d' >workfile
187
+fossil help -v | tail -n +14 | sed '$d' | sed '$d' >workfile
188188
189189
# swap out @ with @@ so texinfo doesn't barf
190190
echo "Doubling up the @'s"
191191
sed -i -e 's/@/@@/g' workfile
192192
@@ -203,12 +203,10 @@
203203
else
204204
# We'll assume we're on a BSD here, even though this won't always be true
205205
gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
206206
fi
207207
208
-# adds linebreak to texinfo output per option line. These start with four spaces.
209
-sed -i -e 's/^ /@*/' workfile
210208
# turns --switches into @option{--switches}
211209
sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
212210
# now do the same for places where there's -f|--force
213211
sed -i -e 's/|--\([[:alnum:]-]\{1,\}\)/|@option\{--\1\}/g' workfile
214212
# turns -switches into @option{-switches}. Usually starts with space
@@ -262,12 +260,10 @@
262260
else
263261
# We'll assume we're on a BSD here, even though this won't always be true
264262
gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
265263
fi
266264
267
-# adds linebreak to texinfo output per option line. These start with four spaces.
268
-sed -i -e 's/^ /@*/' workfile
269265
# turns --switches into @option{--switches}
270266
sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
271267
272268
# ... and adds it to the output file with a spacer line
273269
cat workfile >> fossil.texi
@@ -322,12 +318,10 @@
322318
else
323319
# We'll assume we're on a BSD here, even though this won't always be true
324320
gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
325321
fi
326322
327
-# adds linebreak to texinfo output per option line. These start with four spaces.
328
-sed -i -e 's/^ /@*/' workfile
329323
# turns --switches into @option{--switches}
330324
sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
331325
332326
# ... and adds it to the output file with a spacer line
333327
cat workfile >> fossil.texi
@@ -396,12 +390,10 @@
396390
sed -i -e 's/{/@{/g' -e 's/}/@}/g' workfile
397391
else
398392
gsed -i -e 's/\{/@\{/g' -e 's/\}/@\}/g' workfile
399393
fi
400394
401
-# adds linebreak to texinfo output per option line. These start with four spaces.
402
-sed -i -e 's/^ /@*/' workfile
403395
echo "Swapping out --switches for @option{--switches}"
404396
# turns --switches into @option{--switches}
405397
if [[ ${MYOS} == "Linux" ]]; then
406398
sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
407399
else
@@ -458,7 +450,5 @@
458450
# makeinfo fossil.texi
459451
460452
echo "Done ... for now. Please check fossil.texi file over for inconsistencies, and fill in descriptions."
461453
echo "Once everything's good, you can run your system's makeinfo command to turn"
462454
echo "your .texi file into a .info file to install where you need."
463
-
464
-
465455
--- tools/fossil-makeinfo
+++ tools/fossil-makeinfo
@@ -171,22 +171,22 @@
171 printf "@menu\n" >> fossil.texi
172
173 # Slurp in Common keywords from fossil help
174 # WARNING: tail count is brittle
175 echo "Grab common keywords for menu"
176 for u in $(for t in $(fossil help | tail -n +4| sed '$d'); do echo "$t"; done | sort); do echo "* ${u}::"; done >> fossil.texi
177
178 # Add end menu, add some space too
179 printf "@end menu
180
181 " >> fossil.texi
182
183 # Add in the actual help for common commands
184 # WARNING: tail count is brittle
185 # tail command pops off the first six lines, sed commands remove the last two lines.
186 echo "Fossil output common help to workfile"
187 fossil help -v | tail -n +7 | sed '$d' | sed '$d' >workfile
188
189 # swap out @ with @@ so texinfo doesn't barf
190 echo "Doubling up the @'s"
191 sed -i -e 's/@/@@/g' workfile
192
@@ -203,12 +203,10 @@
203 else
204 # We'll assume we're on a BSD here, even though this won't always be true
205 gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
206 fi
207
208 # adds linebreak to texinfo output per option line. These start with four spaces.
209 sed -i -e 's/^ /@*/' workfile
210 # turns --switches into @option{--switches}
211 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
212 # now do the same for places where there's -f|--force
213 sed -i -e 's/|--\([[:alnum:]-]\{1,\}\)/|@option\{--\1\}/g' workfile
214 # turns -switches into @option{-switches}. Usually starts with space
@@ -262,12 +260,10 @@
262 else
263 # We'll assume we're on a BSD here, even though this won't always be true
264 gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
265 fi
266
267 # adds linebreak to texinfo output per option line. These start with four spaces.
268 sed -i -e 's/^ /@*/' workfile
269 # turns --switches into @option{--switches}
270 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
271
272 # ... and adds it to the output file with a spacer line
273 cat workfile >> fossil.texi
@@ -322,12 +318,10 @@
322 else
323 # We'll assume we're on a BSD here, even though this won't always be true
324 gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
325 fi
326
327 # adds linebreak to texinfo output per option line. These start with four spaces.
328 sed -i -e 's/^ /@*/' workfile
329 # turns --switches into @option{--switches}
330 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
331
332 # ... and adds it to the output file with a spacer line
333 cat workfile >> fossil.texi
@@ -396,12 +390,10 @@
396 sed -i -e 's/{/@{/g' -e 's/}/@}/g' workfile
397 else
398 gsed -i -e 's/\{/@\{/g' -e 's/\}/@\}/g' workfile
399 fi
400
401 # adds linebreak to texinfo output per option line. These start with four spaces.
402 sed -i -e 's/^ /@*/' workfile
403 echo "Swapping out --switches for @option{--switches}"
404 # turns --switches into @option{--switches}
405 if [[ ${MYOS} == "Linux" ]]; then
406 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
407 else
@@ -458,7 +450,5 @@
458 # makeinfo fossil.texi
459
460 echo "Done ... for now. Please check fossil.texi file over for inconsistencies, and fill in descriptions."
461 echo "Once everything's good, you can run your system's makeinfo command to turn"
462 echo "your .texi file into a .info file to install where you need."
463
464
465
--- tools/fossil-makeinfo
+++ tools/fossil-makeinfo
@@ -171,22 +171,22 @@
171 printf "@menu\n" >> fossil.texi
172
173 # Slurp in Common keywords from fossil help
174 # WARNING: tail count is brittle
175 echo "Grab common keywords for menu"
176 for u in $(for t in $(fossil help | tail -n +11| sed '$d'); do echo "$t"; done | sort); do echo "* ${u}::"; done >> fossil.texi
177
178 # Add end menu, add some space too
179 printf "@end menu
180
181 " >> fossil.texi
182
183 # Add in the actual help for common commands
184 # WARNING: tail count is brittle
185 # tail command pops off the first fourteen lines, sed commands remove the last two lines.
186 echo "Fossil output common help to workfile"
187 fossil help -v | tail -n +14 | sed '$d' | sed '$d' >workfile
188
189 # swap out @ with @@ so texinfo doesn't barf
190 echo "Doubling up the @'s"
191 sed -i -e 's/@/@@/g' workfile
192
@@ -203,12 +203,10 @@
203 else
204 # We'll assume we're on a BSD here, even though this won't always be true
205 gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
206 fi
207
 
 
208 # turns --switches into @option{--switches}
209 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
210 # now do the same for places where there's -f|--force
211 sed -i -e 's/|--\([[:alnum:]-]\{1,\}\)/|@option\{--\1\}/g' workfile
212 # turns -switches into @option{-switches}. Usually starts with space
@@ -262,12 +260,10 @@
260 else
261 # We'll assume we're on a BSD here, even though this won't always be true
262 gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
263 fi
264
 
 
265 # turns --switches into @option{--switches}
266 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
267
268 # ... and adds it to the output file with a spacer line
269 cat workfile >> fossil.texi
@@ -322,12 +318,10 @@
318 else
319 # We'll assume we're on a BSD here, even though this won't always be true
320 gsed -i -e 's/^##* \([a-z0-9-]\{1,\}\)/@node \1\n@section \1\n/' workfile
321 fi
322
 
 
323 # turns --switches into @option{--switches}
324 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
325
326 # ... and adds it to the output file with a spacer line
327 cat workfile >> fossil.texi
@@ -396,12 +390,10 @@
390 sed -i -e 's/{/@{/g' -e 's/}/@}/g' workfile
391 else
392 gsed -i -e 's/\{/@\{/g' -e 's/\}/@\}/g' workfile
393 fi
394
 
 
395 echo "Swapping out --switches for @option{--switches}"
396 # turns --switches into @option{--switches}
397 if [[ ${MYOS} == "Linux" ]]; then
398 sed -i -e 's/--\([[:alnum:]-]\{1,\}\)/@option\{--\1\}/g' workfile
399 else
@@ -458,7 +450,5 @@
450 # makeinfo fossil.texi
451
452 echo "Done ... for now. Please check fossil.texi file over for inconsistencies, and fill in descriptions."
453 echo "Once everything's good, you can run your system's makeinfo command to turn"
454 echo "your .texi file into a .info file to install where you need."
 
 
455

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button