Modify

Opened 10 years ago

Closed 9 years ago

#1719 closed Feature Request (Rejected)

Expose the internal function that creates the $CmdLine array?

Reported by: c0deWorm Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: cmdline parsing Cc:

Description

I have several scripts that use Run extensively, and look for processes using specific command line options (such as robocopy processes running against a particular source). While I know checking my command lines with regular expressions is possible, it would be helpful if we had a function we could call that would return an array exactly like $CmdLine from a passed string.

Since the code is already there, presumably you could just expose that code as a function, and use it for actual $CmdLine parsing as well, meaning little or no duplicate code.

Thanks for your time.

Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by Jpm

  • Owner set to Jon
  • Status changed from new to assigned

comment:2 Changed 9 years ago by guinness

Your request can be achieved by using the following example.

#include <Array.au3>
#include <WinAPIEx.au3> ; Download from http://www.autoitscript.com/forum/topic/98712-winapiex-udf/

Local $aArray

$aArray = _WinAPI_CommandLineToArgv(_WinAPI_GetProcessCommandLine(@AutoItPID))
_ArrayDisplay($aArray, '$CmdLine Example')

comment:3 Changed 9 years ago by trancexx

  • Resolution set to Rejected
  • Status changed from assigned to closed

Current solution is reckoned to be sufficient.
For "function approach" consult different UDFs, as guinness did.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.