You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command line options are a bit of a mess. The tool has two different operating modes: "read mode" if one or more resource filters are specified (or if --all is passed), and "list mode" otherwise. Some options only apply to one of the two modes, and setting them in the other mode does nothing. There are also --header-system and --header-application, which are more or less a separate third mode.
To improve this situation, options that are incompatible with the current mode should cause errors. This would likely need to be checked manually, because argparse's mutually exclusive argument groups can't be used to represent the mode switching behavior.
It might also be a good idea to allow (or require) specifying the mode using explicit options, e. g. rsrcfork --list foo.rsrc and rsrcfork --read foo.rsrc "'TEXT'". This would allow for more readable help messages (only options applicable to the specified mode would be shown) and would allow adding more modes in the future (for example if write support is implemented, see #1). This wouldn't be any easier to handle using argparse though.
Since either way argparse's native features are insufficient here, it may be worth switching to another more powerful argument parsing library, such as argh or click.
The text was updated successfully, but these errors were encountered:
The command line options are a bit of a mess. The tool has two different operating modes: "read mode" if one or more resource filters are specified (or if
--all
is passed), and "list mode" otherwise. Some options only apply to one of the two modes, and setting them in the other mode does nothing. There are also--header-system
and--header-application
, which are more or less a separate third mode.To improve this situation, options that are incompatible with the current mode should cause errors. This would likely need to be checked manually, because
argparse
's mutually exclusive argument groups can't be used to represent the mode switching behavior.It might also be a good idea to allow (or require) specifying the mode using explicit options, e. g.
rsrcfork --list foo.rsrc
andrsrcfork --read foo.rsrc "'TEXT'"
. This would allow for more readable help messages (only options applicable to the specified mode would be shown) and would allow adding more modes in the future (for example if write support is implemented, see #1). This wouldn't be any easier to handle usingargparse
though.Since either way
argparse
's native features are insufficient here, it may be worth switching to another more powerful argument parsing library, such as argh or click.The text was updated successfully, but these errors were encountered: