-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error when password starts with "-" #468
Comments
|
@ComvationAG I had the same issue, as a workaround I used command: |
|
Does it work if you use |
|
I've now had time to get to the root of this issue. This issue is caused by the processing of options in the script. We always have to check if the next argument is the next option or the value of the current one. This is done for every every option in the same way, in this case it’s done here: Lines 1546 to 1551 in d496de9
So it does not matter if the value is quoted or not, it is passed to this check. And this check fails because the value starts with a I don’t know of a way to check if the parameter was originally quoted or not. But I can think of other solutions:
REMOTE_PASSWD="$2"
shift
if ! echo "$2" | egrep -q '^-'; then
if echo "$2" | egrep -q '^\\-'; then
REMOTE_PASSWD="${2:1}"
else
REMOTE_PASSWD="$2"
fi
shift
else
print_error_and_die "Too few arguments for option -p." "$ERROR_MISSING_ARGUMENTS"
fi
What do you think? What’s the best way to go? |
|
Thank you for this detailed feedback. My only addition is, that you in the error message ("Too few arguments for option -p ..") a direct link to the documentation part, where the people get informed about limit of a password that starts with '-'. Thank you for your support. |
|
@ComvationAG you‘re welcome.
Yes that’s a good idea. Thank you for this. |
Since passwords with a - as first character are still a problem (see git-ftp#468) this has to be noted. The suggestion to link this doc in the error message is implemented as well. closes git-ftp#468
|
This issue is actually fixed, where you can just use:
In this case not even quotes are needed...
I am looking up history, and the tool supported this already back when this issue was raised, not sure why nobody tried this back then. The |
|
Sometimes you don't think of the simplest solutions. Thanks a lot for your addition 😃 |
Bug
How to reproduce the issue?
git ftp catchup --branch master --user test --passwd "-test"
fatal: Too few arguments for option -p.Can you point to a Git repository to reproduce it?
→ Happen on every git repo.
Or can you describe the directory structure?
→ See previous comment .
Environment
The text was updated successfully, but these errors were encountered: