Ticket #2561 (closed Feature Requests: fixed)

Opened 8 years ago

Last modified 8 years ago

Command line string splitting in Unix

Reported by: Vitaly Grechko <vitaly@…> Owned by: s_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


Change History

comment:1 Changed 8 years ago by s_ochsenknecht

  • Owner changed from vladimir_prus to s_ochsenknecht
  • Status changed from new to assigned
  • Milestone changed from Boost 1.38.0 to Boost 1.42.0

comment:2 Changed 8 years ago by s_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 s_ochsenknecht

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

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


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

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

Note: See TracTickets for help on using tickets.