Advertisement
Guest User

Untitled

a guest
Jun 21st, 2025
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.92 KB | None | 0 0
  1. diff --git a/contrib/zsh_compl/_rgbasm b/contrib/zsh_compl/_rgbasm
  2. index 2998be21e56497349cc026f0d1719626d494eb51..84c97860e6cdc239d2fa73c464b59569312d179d 100644
  3. --- a/contrib/zsh_compl/_rgbasm
  4. +++ b/contrib/zsh_compl/_rgbasm
  5. @@ -8,53 +8,91 @@ _rgbasm_warnings() {
  6.         'extra:Enable extra, possibly unwanted, messages'
  7.         'everything:Enable literally everything'
  8.  
  9.         'assert:Warn when WARN-type asserts fail'
  10.         'backwards-for:Warn when start and stop are backwards relative to step'
  11.         'builtin-args:Report incorrect args to built-in funcs'
  12.         'charmap-redef:Warn when redefining a charmap mapping'
  13.         'div:Warn when dividing the smallest int by -1'
  14.         'empty-data-directive:Warn on arg-less d[bwl] in ROM'
  15.         'empty-macro-arg:Warn on empty macro arg'
  16.         'empty-strrpl:Warn on calling STRRPL with empty pattern'
  17.         'large-constant:Warn on constants too large for a signed 32-bit int'
  18.         'macro-shift:Warn when shifting macro args part their limits'
  19.         'nested-comment:Warn on "/*" inside block comments'
  20.         'numeric-string:Warn when a multi-character string is treated as a number'
  21.         'obsolete:Warn when using deprecated features'
  22.         'purge:Warn when purging exported symbols or labels'
  23.         'shift:Warn when shifting negative values'
  24.         'shift-amount:Warn when a shift'\''s operand it negative or \> 32'
  25.         'truncation:Warn when implicit truncation loses bits'
  26.         'unmapped-char:Warn on unmapped character'
  27.         'unmatched-directive:Warn on unmatched directive pair'
  28.         'unterminated-load:Warn on LOAD without ENDL'
  29.         'user:Warn when executing the WARN built-in'
  30.     )
  31. -   # TODO: handle `no-` and `error=` somehow?
  32. -   # TODO: handle `=0|1|2` levels for `numeric-string`, `purge`, `truncation`, and `unmapped-char`?
  33. -   _describe warning warnings
  34. +       if compset -P 'no-'; then
  35. +               _describe warning warnings
  36. +               return
  37. +       elif compset -P 'error='; then
  38. +               _describe warning warnings
  39. +               return
  40. +       elif compset -P 'numeric-string='; then
  41. +               local numeric_levels=(
  42. +                       '0:Disable this warning'
  43. +                       '1:Warn about strings longer than four characters'
  44. +                       '2:Warn about any multi-character string'
  45. +               )
  46. +               _describe level numeric_levels
  47. +               return
  48. +       elif compset -P 'purge='; then
  49. +               local purge_levels=(
  50. +                       '0:Disable this warning'
  51. +                       '1:Warn when purging any exported symbol'
  52. +                       '2:Warn when purging any label'
  53. +               )
  54. +               _describe level purge_levels
  55. +               return
  56. +       elif compset -P 'truncation='; then
  57. +               local trunc_levels=(
  58. +                       '0:Disable this warning'
  59. +                       '1:Warn when values exceed the target bit-width'
  60. +                       '2:Also warn when values do not fit in two\'s complement'
  61. +               )
  62. +               _describe level trunc_levels
  63. +               return
  64. +       elif compset -P 'unmapped-char='; then
  65. +               local unmapped_levels=(
  66. +                       '0:Disable this warning'
  67. +                       '1:Warn only if the active charmap is not empty'
  68. +                       '2:Warn even if the active charmap is empty or not default'
  69. +               )
  70. +               _describe level unmapped_levels
  71. +               return
  72. +       fi
  73. +
  74. +       _describe warning warnings
  75.  }
  76.  
  77.  local args=(
  78.     # Arguments are listed here in the same order as in the manual, except for the version and help
  79.     '(- : * options)'{-V,--version}'[Print version number and exit]'
  80.     '(- : * options)'{-h,--help}'[Print help text and exit]'
  81.  
  82.     '(-E --export-all)'{-E,--export-all}'[Export all symbols]'
  83.     '(-v --verbose)'{-v,--verbose}'[Print additional messages regarding progression]'
  84.     -w'[Disable all warnings]'
  85.  
  86.     '(-b --binary-digits)'{-b,--binary-digits}'+[Change chars for binary constants]:digit spec:'
  87.     '*'{-D,--define}'+[Define a string symbol]:name + value (default 1):'
  88.     '(-g --gfx-chars)'{-g,--gfx-chars}'+[Change chars for gfx constants]:chars spec:'
  89.     '(-I --include)'{-I,--include}'+[Add an include directory]:include path:_files -/'
  90.     '(-M --dependfile)'{-M,--dependfile}"+[Write deps in make format]:output file:_files -g '*.{d,mk}'"
  91.     -MG'[Assume missing files should be generated]'
  92.     -MP'[Add phony targets to all deps]'
  93.     '*'-MT"+[Add a target to the rules]:target:_files -g '*.{d,mk,o}'"
  94.     '*'-MQ"+[Add a target to the rules]:target:_files -g '*.{d,mk,o}'"
  95.     '(-o --output)'{-o,--output}'+[Output file]:output file:_files'
  96.     '(-P --preinclude)'{-P,--preinclude}"+[Pre-include a file]:include file:_files -g '*.{asm,inc}'"
  97.     '(-p --pad-value)'{-p,--pad-value}'+[Set padding byte]:padding byte:'
  98.     '(-Q --q-precision)'{-Q,--q-precision}'+[Set fixed-point precision]:precision:'
  99.     '(-r --recursion-depth)'{-r,--recursion-depth}'+[Set maximum recursion depth]:depth:'
  100.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement