Issue #7718 has been updated by Nigel Kersten. Affected Puppet version deleted (2.7.0rc3)
Apart from the subsequent inconsistency (which will still be there for the end user if we provide the greedy toggle at a higher level), is it simply not possible for faces to handle this sort of logic themselves? Basically I'm looking for the technical constraints. It's not clear to me whether this is something a Face can implement internally at the moment. ---------------------------------------- Refactor #7718: Faces handle default actions on the command line very strangely... https://projects.puppetlabs.com/issues/7718 Author: Daniel Pittman Status: Needs Decision Priority: Normal Assignee: Randall Hansen Category: Faces Target version: Affected Puppet version: Keywords: Branch: So, we have these default actions implemented on faces to support things like help. Specifically, we have the behaviour that (after options are removed): 1. If you give no arguments on the command line, invoke the default actions. (expected, and reasonable.) 2. If you give arguments on the command line, and the first word matches an action, invoke that action. (expected, and reasonable.) 3. If you give arguments on the command line, but the first word doesn't match an action, invoke the default action with all those words as arguments. (sometimes unexpected, sometimes reasonable.) In the last case we have potentially surprising behaviour: *most* default actions want only a very specific set of arguments, and should fail somehow sensibly if you don't match their expectations. I think. It isn't entirely clear, though, that this is ever right. Some-but-not-all default actions do want arguments, though: consider `puppet help node`, which is properly `puppet help <help> node` once the default action is substituted in, and absolutely does want the arguments. Which we would like to support and, frankly, not restrict to things that we do. Maybe some sort of `default, :arguments => accept` or something would be sensible, to determine if we want the greedy behaviour or not? Maybe a richer `action_missing` hook for the face, allowing it to redirect invocation to where we expect, like Ruby does? Maybe a richer `get_default_action` method that can take into account the arguments? -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
