Skip to main content

resolve_code_args

Function resolve_code_args 

Source
pub fn resolve_code_args(args: &CodeArgs) -> Result<ResolvedCodeArgs>
Expand description

Parse the variadic positional args (1..=3) into target, kind, and name.

  • 1 arg: code NAME → target="self", catch-all. Errors if the single arg is a kind keyword (ambiguous).
  • 2 args: code KIND NAME if arg[0] is a kind keyword, else code TARGET NAME (catch-all).
  • 3 args: code TARGET KIND NAME — arg[1] must be a valid kind.
  • 0 or 4+ args: error with usage.