我最近开始使用 argp 但我找不到一种方法来使我的选项成为必需的。我想在未给出 -u (--url) 和 -w (--wordlist) 时查看帮助。为了让我的程序正常运行,这两者都需要。我在互联网上查看,但在其他地方找不到同样的问题。谢谢您的帮助
精氨酸蛋白
#include "../header/argp.h"
#include <argp.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
const char *argp_program_version = "WiBreak 0.0.1";
static char doc[] = "Program used to brute force URL.";
static char args_doc[] = "[-u URL] [-w WORDLIST]";
static struct argp_option options[] = {
{"url", 'u', "URL_TO_QUERY", 0, "Compare lines instead of characters."},
{"wordlist", 'w', "WORDLIST", 0, "Compare words instead of characters."},
{"verbose", 'v', 0, OPTION_ARG_OPTIONAL, "Show more info"},
{0}};
// TODO: …Run Code Online (Sandbox Code Playgroud)