python - Where in the Hg code is the command completion implemented? -


mercurial has nice feature allows 1 type needed unambiguous on command line, such as:

hg pus 

for pushing, or:

hg comm 

for committing.

i'd love see functionality in likes of git , maven, made me curious how done. had trawl through code not luck, found bash_completion not windows.

where in hg code command completion implemented?

the code commands findpossible , findcmd functions in mercurial.cmdutil. search known commands , find ones start typed, hg pus finds push command.

for command line options (flags), normal getopt module lets shorten, say, hg log --patch hg log --pat automatically.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -