Software / code / prosody
File
core/features.lua @ 13762:81856814d74f 13.0
util.argparse: Fix bug (regression?) in argument parsing with --foo=bar
After recent changes, '--foo bar' was working, but '--foo=bar' was not. The
test had a typo (?) (bar != baz) and because util.argparse is not strict by
default, the typo was not caught.
The typo caused the code to take a different path, and bypassed the buggy
handling of --foo=bar options.
I've preserved the existing test (typo and all!) because it's still an
interesting test, and ensures no unintended behaviour changes compared to the
old code.
However I've added a new variant of the test, with strict mode enabled and the
typo fixed. This test failed due to the bug, and this commit introduces a fix.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 11 Mar 2025 18:27:36 +0000 |
| parent | 13718:569fae28a2f3 |
line wrap: on
line source
local set = require "prosody.util.set"; return { available = set.new{ -- mod_bookmarks bundled "mod_bookmarks"; -- mod_server_info bundled "mod_server_info"; -- mod_flags bundled "mod_flags"; -- mod_cloud_notify bundled "mod_cloud_notify"; -- mod_muc has built-in vcard support "muc_vcard"; -- mod_http_altconnect bundled "http_altconnect"; -- Roles, module.may and per-session authz "permissions"; -- prosody.* namespace "loader"; -- "keyval+" store "keyval+"; "s2sout-pre-connect-event"; -- prosody:guest, prosody:registered, prosody:member "split-user-roles"; -- new moduleapi methods "getopt-enum"; "getopt-interval"; "getopt-period"; "getopt-integer"; -- new module.ready() "module-ready"; -- SIGUSR1 and 2 events "signal-events"; }; };