Description of problem: When using Publican install_book verb it appears that messing up the input to the --lang parameter can have fairly severe consequences. In this case I used tab-completion resulting in issuing the following command: $ publican install_book --site_config /home/sgordon/Source/web/homepage.cfg --lang en-US/ Instead of: $ publican install_book --site_config /home/sgordon/Source/web/homepage.cfg --lang en-US Publican happily process this but the result on the given site is unexpected, in particular: - The drop down has a second entry for 'English' added to it - one for 'en-US' and one for 'en-US/'. - The default selection appears to end up corresponding to 'en-US/', as such all books other than the one published with the incorrect command show up as untranslated. I am guessing it would be difficult to include validation in publican for every possible language code, but I am raising this bug in the hope that: - The trailing slash be stripped as part of the input validation to better accommodate tab completion (or ignored in the logic that caused the above issues). - The language parameter for the install_book verb (possibly others?) be validated to ensure that a directory for the named language actually exists in the current directory. From what I work out this sort of happens at the moment, for instance: $ publican install_book --site_config /home/sgordon/Source/web/homepage.cfg --lang klingon subtitle can not be calculated before building. at /usr/bin/publican line 984 But it would be a 'nice to have' to be more explicit. Version-Release number of selected component (if applicable): publican-2.8-1.fc16.noarch TL;DR: I am lazy and used tab-completion. As a result I temporarily broke docs.fedoraproject.org. Facepalm :(.
Changed bash_completion command for --lang so trailing slash isn't generated. Applied to branches/publican-2x and trunk. Committed revision 1959.
ok the change now causes the following error message: Invalid build request: no PO files exist for language en-US/
(In reply to comment #2) > ok the change now causes the following error message: > > Invalid build request: no PO files exist for language en-US/ Vased on issues in found in this bug, moving from VERIFIED back to ASSIGNED.
> Vased on issues in found in this bug, moving from VERIFIED back to ASSIGNED. Lol Based*
Works for publican install_book. Test_Book]$ publican install_book --site_config ../website/foomaster.cfg --lang en-US/ Test_Book]$ Note: it doesn't work for publican build. I got the same output as Laura did in comment#2 publican build -f html,html-single -l en-US/ Setting up en-US/ Invalid build request: no PO files exist for language en-US/ at /usr/bin/publican line 887
(In reply to comment #5) > Works for publican install_book. > > Test_Book]$ publican install_book --site_config ../website/foomaster.cfg > --lang en-US/ > Test_Book]$ > > > > Note: it doesn't work for publican build. I got the same output as Laura did > in comment#2 > > publican build -f html,html-single -l en-US/ > Setting up en-US/ > Invalid build request: no PO files exist for language en-US/ at > /usr/bin/publican line 887 Removed support for undocumented options. $ publican build -l en-US/ Unknown option: l Usage: ... It's not possible to support short options properly with bash-completion because the context for it changes with the usage but bash completion happens before publican can intervene.
Confirmed that the short options are no longer in publican-3.0-0.fc17.t213.noarch and that tab completion no longer includes a trailing slash.