Jump to content

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...