Using the -p flag creates a misleading error

Hi,

I may have found a small bug with rclone and wished for someone else to confirm and see whether I missed anything.

Typically, if you use an incorrect flag (and correct me if I’m wrong, I’m a new rclone user); you’ll receive a helpful error message "Fatal error: unknown shorthand flag: ‘X’ in -XXXX "
(the command in this case rclone -v -XXXX copy folder_name remote:bucket

But, I accidentally used a lower case p instead of an Upper case one for the progress flag and received an unexpected error:Fatal error: unknown command "folder_name" for "rclone"

The command that I used to generate that error was
rclone -v -p copy folder_name remote:bucket

Could anyone confirm this? I don’t use any other storage system besides b2 so I’m not sure the scope of the bug. Thanks for all the work that you do.

Cheers.

Any wrong command gives you:

2018/09/20 19:48:12 Fatal error: unknown shorthand flag: ‘V’ in -V
or
2018/09/20 19:48:41 Fatal error: unknown shorthand flag: ‘p’ in -p

Yes I see that.

I think it is probably cobra the command line parsing library rclone uses.

I created an issue on their bugtracker: https://github.com/spf13/cobra/issues/750

I might be the code in rclone though that is the problem!