I am trying to write a snippet that allows me to write a helpful usage string for my Python script, and then automatically insert a "if len(argv) != ..." thing below that:
""" $TM_FILENAME ${1:args} """
if len(argv) != <some regex that counts number of words in $1>: exit(1)
$0
Depending on the number of words that I enter for args, I want the appropriate number to be inserted in front of "if len(argv) != ...". What regular expression can do that?
If a regex can't do that, can I somehow insert the results of a shell script (e.g. wc) in a regular expression (which, by the way, seems like a useful thing to be able to do anyways!).
Thanks! Abhi