📄 option.c
字号:
#include "option.h"#include "a64-2.h"static int get_index_opt(struct opt_struct *opts, char *s){ int i = 0; while (opts->opt && !str_cmp(s, opts->opt)) { i++; opts++; } return opts->opt ? i : -1;}struct parse_opt parse_option(int i, char **argv, struct opt_struct *opts){ struct parse_opt ret = { -1, 0 };/* if (argv[i][0]=='-' && argv[i][1]=='-' && argv[i][2] != '-') { ret = get_index_opt(opts, &argv[i][2]); } else */ if (argv[i][0] == '-') { char c[2]; c[0] = argv[i][1]; c[1] = 0; if ((ret.index = get_index_opt(opts, &c[0])) != -1) if (argv[i][2]) ret.ptr = &argv[i][2]; else ret.ptr = argv[i+1]; else if ((ret.index = get_index_opt(opts, &argv[i][1])) != -1) ret.ptr = argv[i+1]; } else if (is_c(argv[i][0]) || argv[i][0] == '_') { ret.index = IS_FILE; } return ret;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -