当前位置: 首页 > news >正文

如何做网站 seo微博 wordpress

如何做网站 seo,微博 wordpress,阿里巴巴国际站运营,如何做全网影视网站#x1f60f;★,:.☆(#xffe3;▽#xffe3;)/$:.★ #x1f60f; 这篇文章主要介绍命令行解析库CLI11配置与使用。 无专精则不能成#xff0c;无涉猎则不能通。——梁启超 欢迎来到我的博客#xff0c;一起学习#xff0c;共同进步。 喜欢的朋友可以关注一下#x… ★,°:.☆(▽)/$:.°★ 这篇文章主要介绍命令行解析库CLI11配置与使用。 无专精则不能成无涉猎则不能通。——梁启超 欢迎来到我的博客一起学习共同进步。 喜欢的朋友可以关注一下下次更新不迷路 文章目录 :smirk:1. 项目介绍:blush:2. 环境配置:satisfied:3. 使用说明 1. 项目介绍 项目Github地址https://github.com/CLIUtils/CLI11 看到一位朋友的评论说平时命令行解析库用CLI11的多这里来学习一下。 CLI11 是一个用于处理命令行参数和选项的 C 库旨在简化 C 应用程序的命令行界面开发。 主要特点 1.简单易用CLI11 的设计目标之一是提供一个简单且直观的 API使开发者能够轻松地定义和解析命令行选项。 2.现代 C 支持CLI11 充分利用了现代 C 的特性包括类型推导、lambda 表达式等使其在语法上更为优雅和灵活。 3.丰富的选项支持支持多种命令行选项包括标志选项flags、位置参数、可选参数、必选参数等可以方便地定义各种复杂的命令行接口。 4.类型安全CLI11 在解析和处理命令行参数时提供了类型安全的机制避免了常见的类型转换错误。 5.灵活的错误处理提供了多种错误处理方式包括参数验证失败时的错误提示、帮助信息的自动生成等。 6.跨平台支持CLI11 可以在主流的操作系统上运行包括 Windows、macOS 和各种 Linux 发行版确保了跨平台的兼容性。 2. 环境配置 ubuntu源码安装CLI11库 git clone https://github.com/CLIUtils/CLI11.git mkdir build cd build cmake .. make sudo make install程序g编译不用加-lCLI11g -o main main.cpp 3. 使用说明 下面是一个解析命令行的示例 #include CLI/CLI.hpp #include iostreamint main(int argc, char **argv) {CLI::App app{CLI11 example};std::string name;app.add_option(-n,--name, name, Your name)-required();CLI11_PARSE(app, argc, argv);std::cout Hello, name ! std::endl;return 0; }官方还给出了一些示例如通过命令行检查如文件、数字范围 // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner // under NSF AWARD 1414736 and by the respective contributors. // All rights reserved. // // SPDX-License-Identifier: BSD-3-Clause#include CLI/CLI.hpp #include iostream #include stringint main(int argc, char **argv) {CLI::App app(Validator checker);std::string file;app.add_option(-f,--file,file, file, File name)-check(CLI::ExistingFile);int count{0};app.add_option(-v,--value, count, Value in range)-check(CLI::Range(3, 6));CLI11_PARSE(app, argc, argv);return 0; }此外还可以和json库一起使用 // Copyright (c) 2017-2021, University of Cincinnati, developed by Henry Schreiner // under NSF AWARD 1414736 and by the respective contributors. // All rights reserved. // // SPDX-License-Identifier: BSD-3-Clause#include CLI/CLI.hpp #include iostream #include memory #include nlohmann/json.hpp #include string #include vector// This example is only built on GCC 7 on Travis due to mismatch in stdlib // for clang (CLI11 is forgiving about mismatches, json.hpp is not)using nlohmann::json;class ConfigJSON : public CLI::Config {public:std::string to_config(const CLI::App *app, bool default_also, bool, std::string) const override {json j;for(const CLI::Option *opt : app-get_options({})) {// Only process option with a long-name and configurableif(!opt-get_lnames().empty() opt-get_configurable()) {std::string name opt-get_lnames()[0];// Non-flagsif(opt-get_type_size() ! 0) {// If the option was found on command lineif(opt-count() 1)j[name] opt-results().at(0);else if(opt-count() 1)j[name] opt-results();// If the option has a default and is requested by optional argumentelse if(default_also !opt-get_default_str().empty())j[name] opt-get_default_str();// Flag, one passed} else if(opt-count() 1) {j[name] true;// Flag, multiple passed} else if(opt-count() 1) {j[name] opt-count();// Flag, not present} else if(opt-count() 0 default_also) {j[name] false;}}}for(const CLI::App *subcom : app-get_subcommands({}))j[subcom-get_name()] json(to_config(subcom, default_also, false, ));return j.dump(4);}std::vectorCLI::ConfigItem from_config(std::istream input) const override {json j;input j;return _from_config(j);}std::vectorCLI::ConfigItem_from_config(json j, std::string name , std::vectorstd::string prefix {}) const {std::vectorCLI::ConfigItem results;if(j.is_object()) {for(json::iterator item j.begin(); item ! j.end(); item) {auto copy_prefix prefix;if(!name.empty())copy_prefix.push_back(name);auto sub_results _from_config(*item, item.key(), copy_prefix);results.insert(results.end(), sub_results.begin(), sub_results.end());}} else if(!name.empty()) {results.emplace_back();CLI::ConfigItem res results.back();res.name name;res.parents prefix;if(j.is_boolean()) {res.inputs {j.getbool() ? true : false};} else if(j.is_number()) {std::stringstream ss;ss j.getdouble();res.inputs {ss.str()};} else if(j.is_string()) {res.inputs {j.getstd::string()};} else if(j.is_array()) {for(std::string ival : j)res.inputs.push_back(ival);} else {throw CLI::ConversionError(Failed to convert name);}} else {throw CLI::ConversionError(You must make all top level values objects in json!);}return results;} };int main(int argc, char **argv) {CLI::App app;app.config_formatter(std::make_sharedConfigJSON());int item;app.add_flag(--simple);app.add_option(--item, item);app.set_config(--config);CLI11_PARSE(app, argc, argv);std::cout app.config_to_str(true, true) std::endl; }以上。
http://www.pierceye.com/news/691368/

相关文章:

  • 网站开发技术说明文档网站审核员做点啥
  • 网站设计与网页设计的区别建设部资质查询网站
  • 教育网站制作哪家服务好网站建设运转
  • 山西省轻工建设有限责网站网件路由器无线桥接
  • 做网站 怎么选择公司wordpress lnmp1.4
  • 网站建设价格标准科技感设计感的展厅
  • 广州番禺建设银行网站登录做摄影网站的目的
  • 前端外包网站php网站开发哪个好
  • 网站开发与维护好找工作吗网站建设招标书模板
  • 浙江金顶建设公司网站房产获客软件
  • 什么网站比较容易做python做网站服务器
  • 东城网站建设微信小程序商店怎么开
  • 企业网站源码千博网站推广怎么做流量大
  • 福州最好的网站建设服务商浙江华临建设集团有限公司网站
  • cdr 做网站支付宝小程序开发者工具
  • 建一个全部由自己控制的网站需要多少钱手机网站大全
  • 酒店电子商务网站策划书网站排名下降的原因
  • 成都网站制作公司报价成都装修公司哪家好
  • 用自己的电脑做网站需要备案吗wordpress rss教程
  • 洛阳网站搭建江西网站建设价格低
  • 戴尔网站建设的目的济宁哪里有做网站的
  • 给单位做网站需要多少钱wordpress手机编辑
  • 网站开发实验报告总结怎样搭建微网站
  • 诸暨有哪些制作网站公司代理品牌
  • jsp mysql 网站开发响应网官方网站
  • 小白网站建设教程服务器域名多少钱
  • 网站建设预付款比例网站平台建设公司经营范围
  • 付费阅读网站代码CMS源码就可以做网站吗
  • 企业网站用视频做首页wordpress 多主题插件下载
  • 阿里巴巴网官方网站新公司在哪做网站