2012/12/18 Iustin Pop <ius...@google.com>:
> +def WriteHaskellCompletion(sw, script, htools=True, debug=True):
> +  """Generates completion information for a Haskell program.
> +
> +  This converts completion info from a Haskell program into 'fake'
> +  cli_opts and then builds completion for them.
> +
> +  """
> +  if htools:
> +    cmd = "./htools/htools"
> +    env = {"HTOOLS": script}
> +    script_name = script
> +    func_name = "htools_%s" % script
> +  else:
> +    cmd = "./" + script

I know it was there in the old code, but you don't need ”./” for
executing commands relative to the current directory if no shell (and
thereby $PATH) is involved. No need to change, just pointing it out.

> +    env = {}
> +    script_name = os.path.basename(script)
> +    func_name = script_name
> +  func_name = GetFunctionName(func_name)
> +  output = utils.RunCmd([cmd, "--help-completion"], env=env, cwd=".").output
> +  (opts, args) = ParseHaskellOptsArgs(script_name, output)
> +  WriteCompletion(sw, script_name, func_name, debug, opts=opts, args=args)
> […]
>  def main():
> @@ -772,29 +812,30 @@ def main():
>    if args:
>      parser.error("Wrong number of arguments")
>
> +  debug = not options.compact

Can you add a comment here along the lines of “Whether to build debug
version of completion script”?

Rest LGTM.

Michael

Reply via email to