mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-28 16:01:15 -03:00
argparse: Pass validation variables as exported
This was written before local-exported variables did anything useful. Passing these vars as local-exports removes the need to define the validation function with `--no-scope-shadowing` which is quite the hack.
This commit is contained in:
@@ -114,7 +114,7 @@ Sometimes you need to validate the option values. For example, that it is a vali
|
||||
|
||||
- ``_flag_value`` will be set to the value associated with the flag being processed.
|
||||
|
||||
If you do this via a function it should be defined with the ``--no-scope-shadowing`` flag. Otherwise it won't have access to those variables.
|
||||
These variables are passed to the function as local exported variables.
|
||||
|
||||
The script should write any error messages to stdout, not stderr. It should return a status of zero if the flag value is valid otherwise a non-zero status to indicate it is invalid.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user