How to implement the --verbose or -v option into a script?

后端 未结 9 1224
渐次进展
渐次进展 2020-12-12 10:35

I know the --verbose or -v from several tools and I\'d like to implement this into some of my own scripts and tools.

I thought of placing:<

9条回答
  •  情歌与酒
    2020-12-12 11:13

    It might be cleaner if you have a function, say called vprint, that checks the verbose flag for you. Then you just call your own vprint function any place you want optional verbosity.

提交回复
热议问题