Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. standard way to parse command line from a string

standard way to parse command line from a string

Scheduled Pinned Locked Moved C / C++ / MFC
linuxquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ribhi Kamal
    wrote on last edited by
    #1

    Hi all! Is there a way to parse command line options from a string/file? I'd prefer a standard library that works on Linux, but if there is some way to do it from boost or some other library please let me know. Please note that I'm NOT talking about command line arguments that are passed to the main function (argv), instead the complete cmdline is saved in a file. Thanks alot!

    CPalliniC D L 3 Replies Last reply
    0
    • R Ribhi Kamal

      Hi all! Is there a way to parse command line options from a string/file? I'd prefer a standard library that works on Linux, but if there is some way to do it from boost or some other library please let me know. Please note that I'm NOT talking about command line arguments that are passed to the main function (argv), instead the complete cmdline is saved in a file. Thanks alot!

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      If you really need a flexible thing, then have a look at Lua[^].

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      modified on Monday, June 27, 2011 4:09 PM

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • R Ribhi Kamal

        Hi all! Is there a way to parse command line options from a string/file? I'd prefer a standard library that works on Linux, but if there is some way to do it from boost or some other library please let me know. Please note that I'm NOT talking about command line arguments that are passed to the main function (argv), instead the complete cmdline is saved in a file. Thanks alot!

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Whether you pulled the string from a file or from the command line, it'd be parsed in the same fashion.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

        1 Reply Last reply
        0
        • R Ribhi Kamal

          Hi all! Is there a way to parse command line options from a string/file? I'd prefer a standard library that works on Linux, but if there is some way to do it from boost or some other library please let me know. Please note that I'm NOT talking about command line arguments that are passed to the main function (argv), instead the complete cmdline is saved in a file. Thanks alot!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Lots of possibilities if you search[^] for them.

          The best things in life are not things.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups