Thread: command line "shell"

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    913

    command line "shell"

    im working on a program that will take in put from the command line or a prompt(not both). i have the command line working fine but i dont know of a good way of doing a "shell". i want the shell to work like the command line options so you could do

    <filename>

    or

    <flag> <data> <filename>

    any ideas on a good way of doing this?

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    I'm not exactly sure what you are asking, but here goes. What I would do with the shell is make a loop that continues looping until valid input is given. You then parse the input and determine what are the flags, data, and file name. The actual parsing depends on what time of way the input is divided and entered.

    Hope that helps.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    sean345, that what i want to do, any ideas on how. my way has bugs and just doesnt seem right, there must be some unofficial standard for this kind of thing.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Try a board search, this is is quite a popular topic.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed