chef-cli icon indicating copy to clipboard operation
chef-cli copied to clipboard

`chef` supports command `chef client`

Open burtlo opened this issue 10 years ago • 6 comments

When teaching a class an attendee typed in chef client. This happened after I showed them chef generate. I helped them find the correct command and we continued the training.

However, I thought about and it seems like it would be something that chef could also support. Calling out to the original chef-client and passing on any of the training arguments (ARGV.shift) to the command.

chef-client is often run with sudo so that would be a little different than the normal workflow but I think that this would make the tools seem more unified.

burtlo avatar May 26 '15 18:05 burtlo

I think this could cause more problems than it would help solve.

chef-client is fundamentally a different tool than chef (a.k.a. chef-dk). The purpose of the DK is to bundle Chef Client and other applications (Berkshelf, FoodCritic, Test Kitchen, etc.) together into one easily installable package. Adding client to the chef command may cause users to struggle to understand or realize that chef-client is a tool bundled with the Chef DK, not related to the chef meta-command.

mcquin avatar Jun 03 '15 17:06 mcquin

+1 to @mcquin's point - I feel like this would engender the wrong idea, especially in a training context, so I'm also against this one as well as chef/chef-dk#404. For the one person it may help, I think it would confuse far more.

cheeseplus avatar Jun 03 '15 17:06 cheeseplus

I saw this again in the fundamentals class that I taught in Boston, MA (7/16/15-7/17/15).

Would a compromise be at least a message that tells the user:

$ chef client

chef-client is fundamentally a different tool than chef (a.k.a. chef-dk). 
The purpose of the DK is to bundle Chef Client and other applications (Berkshelf, FoodCritic, 
Test Kitchen, etc.) together into one easily installable package. Adding client to the chef command 
may cause users to struggle to understand or realize that chef-client is a tool bundled with 
the Chef DK, not related to the chef meta-command.

I know we see these tools as fundamentally different but try explaining that to a user.

burtlo avatar Jul 20 '15 12:07 burtlo

I see the idea of catching the accidental typo of "chef client" to map to "chef-client" as no different than when PowerShell aliases things like "ls" to the equiv posh command. Just catching mistakes - I think it's okay to let this work, but we wouldn't instruct people to run chef-client that way...just a nice little UX thing that might make for a more delightful experience?

mattstratton avatar Jul 20 '15 17:07 mattstratton

Also, if you run chef-client without sudo you pretty much always break anyway, but I do think that having a nice message basically saying "I think you mean 'chef-client'" when someone types in "chef client" would be helpful?

mattstratton avatar Jul 20 '15 17:07 mattstratton

Github flavored error messages:

> chef client
chef: 'client' is not a command. See 'chef --help'.

Did you mean this?
    chef-client

mcquin avatar Jul 20 '15 17:07 mcquin