Input validations for alias
command in pdb
#111719
Labels
type-feature
A feature request or enhancement
alias
command in pdb
#111719
Feature or enhancement
Proposal:
This is kind of between a bug and a feature.
alias
, admittedly a rarely used command, is very unpolished.The documentation claimed
But that's not the truth,
%10
will not work because it contains%1
and we are using pure string replacement. I doubt anyone would need%10
so I just updated the document to imply that we only support up to%9
.All the replaceable parameters should be consecutive as well, if
%*
does not exist. I can't find one reason where an alias needs parameter 1 and 3, but not 2. (Feel free to show a useful example if you can think of one). We should catch this because it's almost definitely a mistake made by users.When using alias, we should match all the replaceable parameters and the user input arguments if
%*
does not exist, otherwise something has to be wrong and we should warn user.I stepped into this today when I was trying to use alias for some testing:
Really confusing huh? What if it's
It'll probably be easier to track the logic and make you realize that there's no replaceable parameters defined in
myp
and it should bealias myp %1
.It's not the most intuitive way but it has been there for a long time. Making the error message better will hopefully make users less confusing.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: