Catch the exception raised with 'hg help <somethingambiguous>'.
Example: 'hg help a'
#!/bin/shhg inittouch unknowntouch ahg add ahg ci -m "1" -d "0 0"touch bhg add bhg ci -m "2" -d "0 0"echo %% Should show unknownhg statushg revert -r 0echo %% Should show unknown and b removedhg statusecho %% Should show a and unknownls