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
If I want to provide an optional argument to my alias, for example !myalias debugmode, the logic inside draconic for parsing arguments is not very helpful.
If I call the following code as !bug hello and just !bug
!alias bug embed
-desc "Hi {{'%1%'}}
The first will print "Hi hello" and the latter "Hi %1%".
I would expect that when %1% is not provided, it would be replaced with an empty string, so we could do something like this:
If I want to provide an optional argument to my alias, for example
!myalias debugmode
, the logic inside draconic for parsing arguments is not very helpful.If I call the following code as
!bug hello
and just!bug
The first will print "Hi hello" and the latter "Hi %1%".
I would expect that when %1% is not provided, it would be replaced with an empty string, so we could do something like this:
However, because it's not replaced, it's impossible to detect if the value isn't provided reliably
Will return "%1%" because both sides of the comparison are replaced.
The only workaround I can think of is something like:
However, that would exclude valid inputs like "Hi 100%"
I do not know that the other argument parse types - "%*%", "&1&", etc work any better.
Proposed Solution: If I was writing this code, I would expect these to be replaced with
None
or "" on no argument receivedThe text was updated successfully, but these errors were encountered: