我想知道是否可以为setup()的entry_points arg中的console_scripts中定义的命令指定别名。
我可以做这样的事情吗?
entry_points={
'console_scripts': ['[command,alias0,alias1,alias2]=packagename.__main__:main'],
},
答案 0 :(得分:1)
Aliasing absolutely works, but not quite in the way you want it to. As long as a slight amount of code duplication is fine for you, you can do this instead:
entry_points={
'console_scripts': [
'command=packagename.__main__:main',
'alias0=packagename.__main__:main',
'alias1=packagename.__main__:main',
'alias2=packagename.__main__:main'
]}