I am writing a little REPL console app, and I read a command, split it, and use a piss-poor switch statement to decide which method to call (instead of using the Strategy Pattern). I then place each command into a history, for audit.
The command line when starting the app, as typed, is lost as it is already split. I would prefer to have the whole command line and get on with my loop and it's own split routine.
Is it possible to get the whole command line somehow?
The read() function reads data previously written to a file. If any portion of a regular file prior to the end-of-file has not been written, read() shall return bytes with value 0. For example, lseek() allows the file offset to be set beyond the end of existing data in the file.
When we say Output, it means to display some data on screen, printer, or in any file. C programming provides a set of built-in functions to output the data on the computer screen as well as to save it in text or binary files.
You can get the entire command line as originally passed to the program via
Environment.CommandLine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With