Open paw-lu opened 2 years ago
@paw-lu hey sorry this is so late! cmd
at this point will not contain the first argument (https://github.com/lime-green/unison-gitignore/blob/master/src/unison_gitignore/main.py#L20-L22) so in your example it should contain ["-auto", "root1", "root2"]
and hence not detect profile usage. I think what I had in mind with this is that the usage of unison profilename [options]
I could detect if seeing if the second argument is an option and hence assume profile is being used. It's weird that unison-gitignore -auto root1 root2
is showing that error message for you though, since that's not how the code should work and I can't reproduce it with using that command
I'm pretty new to Unison, so this might be a misunderstaning on my part! If I understand the following section correcly, it seems that unison-gitignore will mistakingly detect profile usage if any option is provided before the main arguments.
https://github.com/lime-green/unison-gitignore/blob/3ea8e702fe310f47cf2830c9c33ddca7abfff5a5/src/unison_gitignore/util.py#L56-L61
For example:
Again, new to unison, but the usage docs state:
So would detecting if
cmd[1].startswith("-")
even detectprofilename
—or is that not the point?Also thanks for sharing the great tool, it's been incredibly useful to me!