getopt(3)
オプション解析API
getopt(3)
#include <unistd.h> int getopt(int argc, char * const argv[], const char *optdecl); extern char *optarg; extern int optind, opterr, optopt;
getopt(3)に関連したグローバル変数
型 | 名前 | 意味 |
---|---|---|
char* | optarg | 現在処理中のオプションのパラメータ |
int | optint | 現在処理中のオプションのargvでのインデックス |
int | optopt | 現在処理中のオプション文字 |
int | opterr | 真ならばエラー時にgetopt()がメッセージを表示する |