首页 \ 问答 \ 如何在 UStack 上实现虚拟机高可用

如何在 UStack 上实现虚拟机高可用

更新时间:2023-10-25 14:10

最新回答

required_argument(或者是1)时,参数输入格式为:--参数 值 或者 --参数=值。
optional_argument(或者是2)时,参数输入格式只能为:--参数=值。

相关问答

更多
  • 解决方法是从http://directory.fsf.org/选择Software Development,然后选择GNU C的标准库,找到getopt源码,然后放到VC里编译一下,真的没别的办法
  • 从手册页 : 如果该选项具有可选参数,则必须将其直接写入选项字符后(如果存在)。 您的代码按预期工作: ./a.out -c some_argument --> "C-Option: (null)" ./a.out -csome_argument --> "C-Option: some_argument" ./a.out -c=some_argument --> "C-Option: =some_argument" 您可以考虑在'='前添加可选参数名称,如上例所示。 这是另一个讨论这个问题的问题。 UP ...
  • case 'p':之前缺少break case 'p': 。 这就是控制到达port=atoi(optarg); 当“t”被处理时; 然后atoi(optarg)为非数字设备名称返回0,并将此0分配给端口。 Missing break before case 'p':. That's why control reaches port=atoi(optarg); when "t" is processed; then atoi(optarg) returts 0 for non-numeric device ...
  • getopt_long()不是C语言的一部分。 这是一个GNU发明,它在一些C实现中可用,但远不是所有。 glibc中的getopt_long()版本(在大多数Linux发行版中使用)不允许您指定必需的选项。 完成解析命令行后,您必须明确检查它们。 getopt_long() is not part of the C language. It is a GNU invention which is available in some C implementations, but far from all. ...
  • getopt()和getopt_long()都适用于每个正确的char **和int , argv和任何其他char **之间没有区别。 如果你将argv和argc ,或者他们的副本从main传递给你的函数并从那里调用getopt()它将会工作。 展示你的函数如何得到argc和argv ; Both getopt() and getopt_long() will work with every proper char ** and int, there is no difference between ar ...
  • Codeape, 似乎没有办法禁用缩写功能。 您并不是唯一希望获得此功能的人。 请参阅: http : //sourceware.org/bugzilla/show_bug.cgi?id = 6863 不幸的是,似乎glibc开发人员不希望选项,因为上面链接的错误报告已通过“WONTFIX”解决。 你可能在这里运气不好: - Codeape, It appears there isn't a way to disable the abbreviation feature. You aren't alone ...
  • 当处理完所有选项 args时, getopt返回-1。 --stuff被认为是一个带参数的选项,在本例中是someArg1 。 someArg2 arg不以-或--开头,所以它不是一个选项。 默认情况下,这将被置换为argv的末尾。 在getopt返回-1之后,所有非选项args将在从optind到argc-1 argv : while (iarg != -1) { iarg = getopt_long(argc, argv, "s:vh", longopts, &index); // .. ...
  • 编辑: “变量optind是argv中要处理的下一个元素的索引。系统将此值初始化为1.调用者可以将其重置为1以重新开始扫描相同的argv,或者扫描新的参数向量。” 所以,是的。 您可以使用getopt_long再次扫描参数或另一个参数列表。 但是,如果有人先前调用了getopt_long,则必须将全局optind变量设置为1。 请记住,main()中的argv是NULL终止的,而argc long,即; argv [argc] == NULL。 所以你可能必须确保你自己的new_argv的最后一个元素是一个 ...
  • 如果您查看手册页 ,您会看到: 当识别出短选项时, getopt_long()和getopt_long_only()也返回选项字符。 对于long选项,如果flag为NULL则返回val,否则返回0。 因此,如果在调用程序时使用short选项,它将返回该选项字符。 要使函数按照您的意愿运行, 必须在调用程序时使用long参数。 If you check the manual page, you will see that: getopt_long() and getopt_long_only() also ...
  • break在第一次迭代后停止while循环,因此它仅检查第一个选项。 我猜你最初有一个switch语句,所以break被用来退出switch并继续while循环。 由于您没有switch ,因此应该使用空的while循环。 其他事宜: 如果您不希望接受-f选项,则不应传入"f" 。 你可能还想检查'?' 返回值,表示何时使用未知选项。 The break stops the while loop after the first iteration, so it only checks the first o ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)