diff --git a/content/books/things-i-learnt/_index.md b/content/books/things-i-learnt/_index.md index 12e3399..127463f 100644 --- a/content/books/things-i-learnt/_index.md +++ b/content/books/things-i-learnt/_index.md @@ -48,6 +48,7 @@ template = "section-contentless.html" * [If Your Data Has a Schema, Use a Structure](use-structures) * [Don't Mess With Things Outside Your Project](outside-project) * [Resist The Temptation Of Easy](resist-easy) + * [Command Line Options Are Weird, But Helpful](command-line-options) * [Start Stupid](start-stupid) * [Always Use Timezones With Your Dates](use-timezones) * [Always Use UTF-8 For Your Strings](use-utf8) diff --git a/content/books/things-i-learnt/command-line-options/index.md b/content/books/things-i-learnt/command-line-options/index.md new file mode 100644 index 0000000..c5c52b1 --- /dev/null +++ b/content/books/things-i-learnt/command-line-options/index.md @@ -0,0 +1,32 @@ ++++ +title = "Things I Learnt The Hard Way - Command Line Options Are Weird, But Helpful" +date = 2019-07-15 + +[taxonomies] +tags = ["en-au", "books", "things i learnt", "configuration", "command line options", "cli"] ++++ + +In this day and age, when everything has a graphical interface, does it still +makes sense to add command line options to your application? In fact, it does. + + + +When I mentioned the configuration file, you may have thought about using +adding a default path for it and using the same file over and over. + +Well, that's not wrong, but what if you want to use a different configuration? +Would you keep moving the original configuration file to another place, moving +your configuration back and keep this back and forth? Keep both versions and +just use a [symbolic link](https://en.wikipedia.org/wiki/Symbolic_link) with +the configuration filename pointing to the one you want? + +Why not add a command line option in which the user can select which +configuration file should be loaded? + +This would make their life _and yours_ easy. + +Also, be aware that, today, there may be libraries to handle command line in +every language, which will help you build a good command line interface, along +with standardizing it to have the same interface as other applications. + +{{ chapters(prev_chapter_link="/books/things-i-learnt/resist-easy", prev_chapter_title="Resist The Temptation Of Easy", next_chapter_link="/books/things-i-learnt/start-stupid", next_chapter_title="Start Stupid") }} diff --git a/content/books/things-i-learnt/resist-easy/index.md b/content/books/things-i-learnt/resist-easy/index.md index 2b4e853..83544e8 100644 --- a/content/books/things-i-learnt/resist-easy/index.md +++ b/content/books/things-i-learnt/resist-easy/index.md @@ -28,4 +28,4 @@ These days, IDEs can autocomplete almost everything, from function names to even how to name your variables. But using the autocomplete is not always a good solution. Finding better names is. -{{ chapters(prev_chapter_link="/books/things-i-learnt/outside-project", prev_chapter_title="Don't Mess With Things Outside Your Project", next_chapter_link="/books/things-i-learnt/start-stupid", next_chapter_title="Start Stupid") }} +{{ chapters(prev_chapter_link="/books/things-i-learnt/outside-project", prev_chapter_title="Don't Mess With Things Outside Your Project", next_chapter_link="/books/things-i-learnt/command-line-options", next_chapter_title="Command Line options Are Weird, But Helpful") }} diff --git a/content/books/things-i-learnt/start-stupid/index.md b/content/books/things-i-learnt/start-stupid/index.md index d313143..0145706 100644 --- a/content/books/things-i-learnt/start-stupid/index.md +++ b/content/books/things-i-learnt/start-stupid/index.md @@ -31,4 +31,4 @@ what your IDE is doing. And when you grasp that, you'll be able to use _any_ IDE. -{{ chapters(prev_chapter_link="/books/things-i-learnt/resist-easy", prev_chapter_title="Resist The Temptation Of Easy", next_chapter_link="/books/things-i-learnt/use-timezones", next_chapter_title="Always Use Timezones With Your Dates") }} +{{ chapters(prev_chapter_link="/books/things-i-learnt/command-line-options", prev_chapter_title="Command Line Options Are Weird, But Helpful", next_chapter_link="/books/things-i-learnt/use-timezones", next_chapter_title="Always Use Timezones With Your Dates") }}