Line completion with custom commands

后端 未结 6 1019
抹茶落季
抹茶落季 2020-12-23 17:33

my Python program can be launched with a range of different options (or subcommands) like:

$ myProgram doSomething
$ myProgram doSomethingElse
$ myProgram no         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 17:45

    If you want your program to select an command line option even though you only used an abbreviated form of this option you should have a look at the optparse module in the standard library.

提交回复
热议问题