nk412 / optparse

Simple command line arguments parser for BASH

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

optparse.bash: line 60: rpad: command not found

livibetter opened this issue · comments

I was trying the sample_head.sh and got four of this:

optparse.bash: line 60: rpad: command not found

I don't have rpad command on my system, which is Gentoo and I don't think it's available to Gentoo since I couldn't search any packages include that filename. And I couldn't find the real source so I could install it, either.

Anyway, judging by its name and the problematic line 60:

optparse_usage="${optparse_usage}#NL#TB${short} $(rpad "$long:" 25)  ${desc}"

Since this project is using Bash, I think just using printf:

printf -v optparse_usage "%s#NL#TB%s %-25s  %s" "$optparse_usage" "$short" "$long:"$desc"

Like I said I don't have rpad, so I couldn't test it with real a run, but I believe it should give exactly the same result.

Should've switched to "closed issues," so I'd see #4 and commented on that instead.

It's said "fixed," but it's not. Forget to pull?

Sorry, I forgot to push. Should now be fixed. :)