Jump to content
Sign in to follow this  

Command line argument handling (again)

Recommended Posts


My old version is >here. This is a complete rewrite, though is mostly backwards compatible.

CmdLine.au3: http://gist.github.com/MattDiesel/5759477

Example (uses _CmdLine_Process for convenience): 

#include "CmdLine.au3"


_CmdLine_Register("hello", "h", $CLF_HASPARAM + $CLF_PARAMOPTIONAL, "Says hello to someone", _
        "This function prints a message that says hello to `WHO`, and then exits.", "WHO", "World", "_Hello")

ConsoleWrite("----" & @LF)
_CmdLine_Process("-h Matt")
ConsoleWrite("----" & @LF)
_CmdLine_Process("--help --hello")

Func _Hello($who)
    ConsoleWrite(StringFormat("Hello, %s!\n", $who))
EndFunc   ;==>_Hello

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.