Archisteamfarm: Ignore extra whitespaces?

Created on 21 Apr 2016  路  6Comments  路  Source: JustArchiNET/ArchiSteamFarm

If we accidentally put a extra whitespace after a command, it won't work. For example, sometimes when I copy a CD-KEY, it comes with a whitespace in the beginning of it. So, if I try to !redeem it to a specific bot, the command will not work:

14:42 - MASTER: !redeem BOT聽聽K3MLH-BCC5D-PP02H

I haven't tested all commands but !stop and !owns also fail if we add extra whitespaces after them. I know it's stupid but it's quite annoying to re-type these commands. :smile:

Not a bug Question

Most helpful comment

image

All 6 comments

ASF is not able to smartly guess when your space means a separator for arguments in command, and when it's your own mistake that should be corrected.

Adding a fixup logic would mean also adding hidden bugs and unintended behaviours such as ASF ignoring valid whitespaces that could be used in future for separating more arguments.

Although I have an idea that could work, let me check.

Are you sure? If we look at large projects like bash, for example, all its purpose is to write commands, and they ignore extra whitespaces in arguments, unless the argument is between quotes.

Bash is shell interpreter, and not C# programming language. It works in totally different way and doesn't split on spaces, instead, is using getopts.

How about just decreasing consecutive spaces to just one? It should not be very hard to implement, and I doubt we would ever need two or more consecutive spaces in commands.

image

That should fix your problem, while still not breaking the way how everything works :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

guihkx picture guihkx  路  4Comments

undefo picture undefo  路  4Comments

Botan626 picture Botan626  路  4Comments

jat001 picture jat001  路  4Comments

light444 picture light444  路  3Comments