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
Create some form of macro, etc. so we would have at least a short form mechanism to input commands.
There appear to be several different approaches to this:
Create short forms for command names and commands that would alias for the commands. There are actually several examples of this and the changes would be simply a minor change to the extensions for click. There are a couple of possible ways to do this:
a. The example that is in the click documentation where the click class is extended when it searches for each command to determine when it has a unique set of characters. There would be no changes to help, etc. just the search for a unique set of characters for the particular command and if the user correctly picked a unique set, that command would be executed. Thus, in our case ("class enumerate") could be executed as "cl en". To see the code, look in the click documentation
b. Extend click to allow defining specific aliases for each command with the decorators that defined the command groups and commands, Again this is probably not difficult and there are several working examples of the techniques which include:
i. a specific "alias" option for the command group which would allow us to define short forms for command names and command group names. See: https://stackoverflow.com/questions/46641928/python-click-multiple-command-names or https://github.com/click-contrib/click-aliases/tree/master/click_aliases,
ii. Extend the code so that the name becomes a list with the first as default. Similar result to i above, just slightly different code change and possibility of multiple alternate names for commands. See: https://click.palletsprojects.com/en/8.0.x/advanced/
iii. Note that there is another variation in a click example at: https://github.com/pallets/click/tree/main/examples/aliases
It allows defining a config file containing the aliases but does not distinguish the various string replacements by command, etc. Thus one could use cl for class but that means anywhere class was defined as a command/group cl would be substituted.
Create a macro system similar to the git macros so that there would be a general capability to replaces components of the the input string with defined alternatives. This would allow the user to define string transforms for the command input strings for what is on the click command line. This would be completely new work and I do not have any idea today of the level of complexity of doing this within the command processing mechanisms of click. While it is the most complete solution, it is obviously by far the most complex.
The text was updated successfully, but these errors were encountered:
After dicsussion we agreed that this was very low priority because of the other means we have to shorten input (ex. autocomplete) and we might not do it al all. We left open as future possibility
Create some form of macro, etc. so we would have at least a short form mechanism to input commands.
There appear to be several different approaches to this:
Create short forms for command names and commands that would alias for the commands. There are actually several examples of this and the changes would be simply a minor change to the extensions for click. There are a couple of possible ways to do this:
a. The example that is in the click documentation where the click class is extended when it searches for each command to determine when it has a unique set of characters. There would be no changes to help, etc. just the search for a unique set of characters for the particular command and if the user correctly picked a unique set, that command would be executed. Thus, in our case ("class enumerate") could be executed as "cl en". To see the code, look in the click documentation
b. Extend click to allow defining specific aliases for each command with the decorators that defined the command groups and commands, Again this is probably not difficult and there are several working examples of the techniques which include:
i. a specific "alias" option for the command group which would allow us to define short forms for command names and command group names. See: https://stackoverflow.com/questions/46641928/python-click-multiple-command-names or
https://github.com/click-contrib/click-aliases/tree/master/click_aliases,
ii. Extend the code so that the name becomes a list with the first as default. Similar result to i above, just slightly different code change and possibility of multiple alternate names for commands. See: https://click.palletsprojects.com/en/8.0.x/advanced/
iii. Note that there is another variation in a click example at: https://github.com/pallets/click/tree/main/examples/aliases
It allows defining a config file containing the aliases but does not distinguish the various string replacements by command, etc. Thus one could use cl for class but that means anywhere class was defined as a command/group cl would be substituted.
Create a macro system similar to the git macros so that there would be a general capability to replaces components of the the input string with defined alternatives. This would allow the user to define string transforms for the command input strings for what is on the click command line. This would be completely new work and I do not have any idea today of the level of complexity of doing this within the command processing mechanisms of click. While it is the most complete solution, it is obviously by far the most complex.
The text was updated successfully, but these errors were encountered: