Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:11:50+00:00 2026-06-12T09:11:50+00:00

I have a tool that takes input and makes output : $ tool input

  • 0

I have a tool that takes input and makes output:

$ tool input > output

I’d like to add an option that is a long string — say, a “comment” option. This comment text is an argument to the option and is a sentence enclosed in forward tick marks:

$ tool --comment='I am commenting on the use of comments' input > output_plus_comment

This is different from the usual --foo=bar key-value pairing, where foo is the option name and bar is a one-word value (e.g., true, red, …).

Is there a good command-line parser library for C that handles this particular case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:11:51+00:00Added an answer on June 12, 2026 at 9:11 am

    Tokenizing the command line into arguments for your program is the responsibility of your shell, not yours. So there’s nothing for you to do.

    Just put quotation marks around strings that contain spaces, or escape spaces with backslashes on your command line, and your --foo value can contain as many spaces as you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any tool that can parse/conver xml files to this format? I have
Our current scenario is like this: we have an existing database that needs to
I have a small deploy tool that I'm upgrading. The tool takes a version
I have a tool that is setup to query our Clearquest Database to return
I have a rename tool that sets a folder directory, however I created some
I have a GUI tool that manages state sequences. One component is a class
So I have an app (tool) that uses .NET 3.0. When run on a
I have a 3rd Party tool that generates an xml spreadsheet (*.xls). I have
I have been using the 'Web Site Administration Tool' that you can bring up
I have an application which runs a tool that requires network connection. Now my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.