@@ -21,7 +21,7 @@ LC_ALL=C
2121export LC_ALL
2222
2323readonly APP_NAME=" git-ssh"
24- readonly VERSION=" 3.2.2 "
24+ readonly VERSION=" 3.2.3 "
2525readonly CONFIG_VERSION=2
2626
2727# Where our configs live
@@ -69,7 +69,7 @@ reset Reset GIT_SSH_COMMAND, unsetting an exported configs
6969help | -H | --help This help
7070version | -V | --version Display application version
7171EOF
72- ) "
72+ ) " 1>&2
7373 return 0
7474}
7575
@@ -97,7 +97,7 @@ _list_configs() {
9797 if { [ -n " ${list_configs__verbose} " ] && { [ " ${list_configs__verbose} " = " -v" ] || [ " ${list_configs__verbose} " = " --verbose" ]; }; }; then
9898 _log ' Config: %s [%s]\n' " $( basename " ${_config} " ) " " ${_config} "
9999
100- printf -- ' %s\n\n' " $( cat " ${_config} " ) "
100+ printf -- ' %s\n\n' " $( cat " ${_config} " ) " 1>&2
101101 else
102102 _config_namelen=" $( printf -- ' %s' " $( basename " ${_config} " ) " | wc -m) "
103103 _config_spacelen=" $(( list_configs__spacecount - _config_namelen)) "
@@ -128,7 +128,7 @@ Arguments:
128128<path> The absolute file path to the SSH private key for this configuration.
129129
130130EOF
131- ) "
131+ ) " 1>&2
132132}
133133
134134# #
@@ -304,7 +304,7 @@ Options:
304304[-a | --add] Add the exported SSH key to the agent if it is not already present.
305305
306306EOF
307- ) "
307+ ) " 1>&2
308308}
309309
310310# #
@@ -400,10 +400,17 @@ main() {
400400 return 0
401401 ;;
402402 export)
403- main__config=" $2 "
404- if [ -z " ${main__export_add_key} " ]; then
403+ # -a can be before the config or after the config like the old way
404+ case " $2 " in
405+ -a | --add)
406+ main__export_add_key=" $2 "
407+ main__config=" $3 "
408+ ;;
409+ * )
410+ main__config=" $2 "
405411 main__export_add_key=" $3 "
406- fi
412+ ;;
413+ esac
407414 _export_config " ${main__config} " " ${main__export_add_key} " || return 1
408415 return 0
409416 ;;
0 commit comments