k3c icon indicating copy to clipboard operation
k3c copied to clipboard

Logs syntax was not as expected

Open alexellis opened this issue 5 years ago • 4 comments

This command works: k3c logs -f 1e51768333bc

This one doesn't work, but I use this order a lot: k3c logs 1e51768333bc -f - "logs" requires exactly 1 argument, see --help

alexellis avatar Jan 07 '20 08:01 alexellis

@ibuildthecloud I know you shared some feelings about Cobra, but for its downsides, it does get the ordering of flags "right" and is consistent with the other tooling we're used to like docker / kubectl.

alexellis avatar Jan 14 '20 08:01 alexellis

Yes and no. For example. docker run foo bar -it and docker logs asdf -f have different expected behavior. In this project I tried using urfave 2. In urfave 1 there was an option for this SkipArgReorder. I'm guessing it got dropped? I'll figure out what happened, maybe revert to urfave 1.

ibuildthecloud avatar Jan 15 '20 00:01 ibuildthecloud

I see your point with -t -i in docker run.. Thanks for looking, I think adding -f or --tail 100 to the end of a logs statement is important.

alexellis avatar Jan 15 '20 09:01 alexellis

@alexellis Sorry that was the point I was making. In docker run foo bar -i the -i should not be treated as a flag. In docker logs foo -f you want it treated as a flag. I'll look at cobra.

ibuildthecloud avatar Jan 15 '20 16:01 ibuildthecloud