Tcl Library Source Code

Check-in [9064b9d02f]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update to-do list
Timelines: family | ancestors | descendants | both | amg-argparse
Files: files | file ages | folders
SHA3-256: 9064b9d02f2f36099ab87cfc523c87c40420091238589a841f60ba05d648fff6
User & Date: andy 2019-04-26 17:51:32
Context
2019-04-26
17:52
Beginnings of effort to rework validation to allow validators to see all results, not just the current value Leaf check-in: 36387739e6 user: andy tags: amg-argparse-validation
17:51
Update to-do list Leaf check-in: 9064b9d02f user: andy tags: amg-argparse
17:51
Continue writing documentation check-in: 2c12551d21 user: andy tags: amg-argparse
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/argparse/TODO.md.




1
2
3
4
5
6
7














8
9
10
11
12
13
14


- Remove `-boolean` 
  - Instead, act as if `-boolean` were always being passed to [argparse]
  - Remove `-keep` as well
  - Add an `-unset` switch to selectively change the behavior to unsetting a
    variable or omitting a dict key when the switch is not present
- Remove `-switch` and `-parameter`
  - Instead make `-` "shorthand" mandatory when declaring a switch














- Documentation
  - Instead of having a big comment, use doctools
- Help text generation
  - Parameter and switch descriptions given by per-element `-help` switch
  - Need overall `-help` switch to provide narrative description
  - May need special grouping elements to organize switches and parameters
  - Text formatting and word wrapping
>
>
>







>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
- Add switch to put parameters before switches
  - Some Tcl commands work this way
  - Examples: [chan copy], [zlib gunzip], [clock], [registry broadcast]
- Remove `-boolean` 
  - Instead, act as if `-boolean` were always being passed to [argparse]
  - Remove `-keep` as well
  - Add an `-unset` switch to selectively change the behavior to unsetting a
    variable or omitting a dict key when the switch is not present
- Remove `-switch` and `-parameter`
  - Instead make `-` "shorthand" mandatory when declaring a switch
- Change from a result dict to a result array
  - Makes more complex validation expressions possible
  - If `-inline` is used, use [array get] to get the return value
- Allow validation expressions to see the result array, not just the switch or
  parameter being validated
  - Use [upvar] rather than [array get] and [array set] to expose the result
    array into the validation expression
  - Also use [upvar] to link the arg variable to the current value
  - Validation expressions can then be (ab)used to modify the results
  - Necessary to do validation expressions as a separate final pass
  - Still do enumeration immediately so their final result values will be
    reflected in the validation
- Allow enumerations to have validation expressions
  - No real reason why these two have to conflict
- Documentation
  - Instead of having a big comment, use doctools
- Help text generation
  - Parameter and switch descriptions given by per-element `-help` switch
  - Need overall `-help` switch to provide narrative description
  - May need special grouping elements to organize switches and parameters
  - Text formatting and word wrapping