Cli flag hierarchy and how to deal with it in code.


Cli flag hierarchy and how to deal with it in code.

I believe the title is self explanatory but I'll elaborate. The best description I can give is using an example ; so let me use the Linux "find" command. For basic searches by name I can simply use – "find . -name "*mp4" ". However, there are numerous other flags I can optionally include. For example the -depth flag.

Programmatically how do you deal with optional flags and especially optional flags with hierarchical dependencies.

I hope I'm being clear enough. Is this a matter of clever switch statement use, combined with if/else blocks. On its face it doesn't seem that simple.

Submitted July 14, 2017 at 02:18AM by ops-man
via reddit http://ift.tt/2sVhJMk

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s