Opened 9 years ago

Closed 8 years ago

#2561 closed Feature Requests (fixed)

Command line string splitting in Unix

Reported by: Vitaly Grechko <vitaly@…> Owned by: Sascha Ochsenknecht
Milestone: Boost 1.42.0 Component: program_options
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:


For now it is not possible to pass the whole command line as a string for Unix when 'argc,argv' are not available. The library does have a function split_winmain(str) but it is available only if _WIN32 macro is defined. Also it is useful to remove _WIN32 limitation for split_winmain because it can be used in UNIX for example in client/server applications

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by Sascha Ochsenknecht

Milestone: Boost 1.38.0Boost 1.42.0
Owner: changed from Vladimir Prus to Sascha Ochsenknecht
Status: newassigned

comment:2 Changed 8 years ago by Sascha Ochsenknecht

I added a general split function which can split a given string at a defined set of character. The result is then stored in a vector of strings which is returned which can be passed to the command line option parser.

I also added a test case for it test/split_test.cpp which should describe from the user point of view how this function works.

For more complex spitting the user has to provide its own implementation.

Hope it is useful

Cheers, Sascha

comment:3 Changed 8 years ago by Sascha Ochsenknecht

Resolution: fixed
Status: assignedclosed

(In [57971]) add general split function, Fixes #2561

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Sascha Ochsenknecht.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.