您的位置:首页 > 运维架构

process the options for command

2007-08-16 19:42 176 查看
/session: things about the command process their options.

similar method used as process the options for command:

cat.c  c = getopt(argc, argv, "usvtebn") 

ls.c c = getopt(argc, argv,     "aAbcCdeEfFghHilLmnopqrRsStux1@vV")

mkdir.c c = getopt(argc, argv, "m:p")

Take cat.c as an example:

"usvtebn" flags are used, accordingly several global static variable used:

static int silent = 0;  /* s flag */
static int visi_mode = 0;  /* v flag */
static int visi_tab = 0;  /* t flag */
static int visi_newline = 0; /* e flag */
static int bflg = 0;  /* b flag */
static int nflg = 0;  /* n flag */

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  command newline c
相关文章推荐