thenightwassaved / hscore

Personal HSCore Development
2 stars 0 forks source link

Standardize command options in code #4

Open thenightwassaved opened 12 years ago

thenightwassaved commented 12 years ago

Currently all parsing for command options are done within the command itself. I recommend switching to argtable (http://argtable.sourceforge.net/) which would make parsing much easier.

The only change seen by users would be, I think, having short options be in this syntax:

?buy -c5 Repel

Opposed to:

?buy -c 5 Repel

This would also allow verbose options like so:

?buy --count=5 Repel

It also auto generates a correct example line syntax and option table for output to users along with automatic error handling.

thenightwassaved commented 12 years ago

It would also be possible to pre-parse the raw string to remove the space after the short option before passing to argtable.

HasteDC commented 12 years ago

Don't really think this kind of thing's important. People are used to what's possible now, and the only people really using command options generally know what they're doing anyways.

Then again, it's welcome. Keep in mind dependencies on the server are an issue. Don't count on libraries that require downloading on the server.

thenightwassaved commented 12 years ago

I shall not. The implementation of this will just make the code a lot more clean (basically removing all the command parsing) and make it easier to change in the future. The package for it could just be included inside HSCore / an existing file / etc.