Command-Line Parsing
In the previous chapter, we created a console application and learned how to pass parameters to it, converting these parameters to their expected data type when needed (remember that parameters passed to a console application are of the String
type).
However, even though a console application is at the heart of a CLI application, a CLI application is more than just a console application. A CLI application contains named parameters, switches, and subcommands to achieve the intended goal.
Armed with our knowledge of creating console applications, we’ll build on top of that to learn how to create a CLI application.
To do so, in this chapter, we’ll cover the following topics:
- Creating the console application
- Parsing the arguments of a console application
- From console to CLI: parsing the arguments using an existing library
By the end of the chapter, you will learn how to start with a simple console application and convert...