proxie has asked for the wisdom of the Perl Monks concerning the following question:
Since it's difficult to parse what's really going on when it's all a single line, I instead would like to create a script that would take this command line as input and effectively print out something like the below in a kind of tree format:execute test_number_1 -tex -tex_args -sub_args +debug_dir=./ -sub_args + +debug_dir=./ -constraint parity_en,random_en -sub_args '"' ruck=1 ' +"' -constraint dual_en -sub_args -cd -sub_args 2596.slow -sub_args te +st -seed 1 -tex_args- -opt 1 -tag 2
Can someone help me get started on the most efficient reg exps to do this? There are certain anchors I can see in which to key off of in terms of knowing when to tab, but it's not consistent. For instance, can't always use the "-" reliably to know when to tab over.execute test_number_1 -tex -tex_args -sub_args +debug_dir=./ -sub_args +debug_dir=./ -constraint parity_en,random_en -sub_args '"' ruck=1 '"' -constraint dual_en -sub_args -cd -sub_args 2596.slow -sub_args test -seed 1 -tex_args- -opt 1 -tag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with parsing command line to make more readable
by tybalt89 (Monsignor) on Aug 19, 2018 at 18:11 UTC | |
by AnomalousMonk (Archbishop) on Aug 19, 2018 at 20:23 UTC | |
by AnomalousMonk (Archbishop) on Aug 19, 2018 at 21:38 UTC | |
|
Re: Help with parsing command line to make more readable
by LanX (Saint) on Aug 19, 2018 at 19:05 UTC | |
|
Re: Help with parsing command line to make more readable (updated)
by AnomalousMonk (Archbishop) on Aug 20, 2018 at 06:52 UTC | |
by proxie (Novice) on Aug 21, 2018 at 03:53 UTC | |
|
Re: Help with parsing command line to make more readable
by kcott (Archbishop) on Aug 20, 2018 at 12:19 UTC | |
by proxie (Novice) on Aug 21, 2018 at 03:52 UTC |