<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I have managed to implement a working command line but I am struggling to figure out how to return the ok(X) value to my caller, I have written a predicate that I call from main():</div><div class=""><br class=""></div><div class=""> <span style="font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);" class="">:-</span><span style="font-size: 12px; white-space: pre; color: rgb(215, 58, 73);" class=""> pred</span><span style="font-size: 12px; white-space: pre; background-color: rgb(255, 255, 255);" class=""> do_command_line(</span></div><div style="background-color: rgb(255, 255, 255); font-size: 12px; line-height: 18px; white-space: pre;" class=""><div class=""><span style="white-space:pre" class="Apple-tab-span"> </span> list(string)::out,</div><div class=""><span style="white-space:pre" class="Apple-tab-span"> </span> getopt_io.option_table(?)::out,</div><div class=""><span style="white-space:pre" class="Apple-tab-span"> </span> io::di, io::uo</div><div class=""> ) <span style="color: #d73a49;" class="">is</span> <span style="color: #005cc5;" class="">det</span>.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I know that ok(X) indicates an option table is now open to being queried etc but I can’t work out what actual type I need to use. I want to pass this object into the following code so that it can act on the various settings that were specified. The declaration of option_table is:</div><div class=""><br class=""></div><div class=""><div style="line-height: 18px;" class=""><div class="">:-<span style="color: #d73a49;" class=""> type</span> option_table(OptionType) == map(OptionType, option_data).</div><br class=""></div></div><div style="line-height: 18px;" class="">But I have so far failed to make the mental connection between whatever is in OptionType and the fact that my options look like this:</div><div style="line-height: 18px;" class=""><br class=""></div><div style="line-height: 18px;" class=""><div style="line-height: 18px;" class=""><div class="">:-<span style="color: #d73a49;" class=""> pred</span> short_option(char::in, option::out) <span style="color: #d73a49;" class="">is</span> <span style="color: #005cc5;" class="">semidet</span>.</div><br class=""><div class="">short_option(<span style="color: #032f62;" class="">'h'</span>, help).</div><div class="">short_option(<span style="color: #032f62;" class="">'v'</span>, version).</div><div class="">short_option(<span style="color: #032f62;" class="">'w'</span>, code_wrap).</div><div class="">short_option(<span style="color: #032f62;" class="">'s'</span>, syntax_check).</div><div class="">short_option(<span style="color: #032f62;" class="">'t'</span>, target).</div><div class="">short_option(<span style="color: #032f62;" class="">'T'</span>, list_targets).</div><div class="">short_option(<span style="color: #032f62;" class="">'o'</span>, output).</div><div class="">short_option(<span style="color: #032f62;" class="">'p'</span>, packed).</div><div class="">short_option(<span style="color: #032f62;" class="">'e'</span>, error_mode).</div><div class=""><br class=""></div><div class="">I want to just call, from main(),</div><div class=""><br class=""></div><div class=""><span style="white-space:pre" class="Apple-tab-span"> </span>do_command_line(FileNames, Options, !IO),</div><div class=""><br class=""></div><div class="">But I don’t know what type to make `Options`.</div><div class=""><br class=""></div><div class="">Thank you.</div><div class="">Sean</div><div class=""><br class=""></div></div></div></div></body></html>